Improve email handling