refactor aggregation config