Introduce makdirp package.
Use mkdirp in replace of _prepareDirectory.