simplify the reset password function.