Refactor hash.