refactoring
added createDirectory