More cipher refactoring.