split out aggregation into separate file