Refactor encryption to optional