refactored build scripts to use directory.read/write and for/else