Merge the same code into genTargets, which removes the need to save the private key to disk and read it again.