Add groups function and refactoring