Refactors getting list of groups into GroupManager