RSA code cleanup