small changes at GetGroups and moved functions into class