normalizing getUserGroups function