working towards equivalence refactoring