factoring out MailToolContext from Main