Why move this code to the EmailAgent?