Refactoring MD hash functions.