Email delivery refactor