group select refactor