Refactored Cipher