Structural Recursion - handling nested objects