refactoring precheck logic (subdirectory existence, file permissions etc) for unsplitting into separate methods