Moved the group_by into the common module.