refactored password reset