improve group handling