Cleanup aggregation function framework