improve KeyGroup#merge