Refactor the grouping stuff into _group, unfinished