Grouping iterator