Refactor group model