A bit more refactoring towards subgroup support.