factored out EquivalenceMap