build script optimization