Refactoring groups app