refactors  hash