refactored the emailer again