refactor reset password