major cleanup and refactoring to use the methods for directory and file creation. also removed ignore_failures