preselect groups works
small refactor