refactor reverseHash