build scripts refactored