Refactor the way groups work