Remove log import.
Refactor mail delivery logic to separate file.