refactoring rsa