refactor group ids