refactoring email sending logic and passport logic, other email update stuff