refactor md4