HDFS-5615: more refactoring