Use $.map to cleanup aggregation logic.