Serialize complex objects