Updated attribute parsing to handle nested objects