grousp.js refactoring