[IMP] mail: Improve code