refactor and DirChunkWriter
remove debug print statement