Refactored block compare and hash function into dedicated file