improving email handling a bit