Optimize the implementation of gen-prebuilt tools.