No need for these if-checks - just execute `resolveGroup()`, it will return null if it was not a group. It already does these checks and is inlined, so no performance loss?