Hashing refactoring