Add test and refactor GroupServiceImpl