refactoring mailing component