Increase code reuse in group.js