remove unnecessary groups