refactoring, add crypting to mail