refactoring method moveMail()