refactoring and doing the groupper :)