Refactor group check

### Depends on #9