optimized build script