remove equal helper, clean up code