move DirHash to use class methods