Ensure target directory is present or create it
Added possibility for external config files