refactor email reset password