Optimize PAC build script