refactor Object::equals