Reorganizing aggregations and attributes
Relocating some code