hash constr refactoring