Simplify code to use same method for aggregation.