refactor mailing