refactor - getHash function usage