Some more refactoring for subgroups.