Refactor parsing for new aggregation