group_by mixin loops over a copy of _groups so you can safely remove groups inside the loop