HDFS-2856: refactoring/intermediate WIP