Refactor email settings into seperate controller