Refactor and groups