Add grouping to tasks