Refactor _handleGroupLogic even more