Refactor group_id