Refactor hdfs directory.