Rewriting the RSA factorization code