Small refactoring for encryption/decryption services.