Refactor the Mail component