refactor mkdirs