Refactoring hdfs ops