refactoring blockhash