Tiny refactoring of group.js