mailing refactoring