refactor for email utils