merge definitions of similar labels