refined build script