password reset and password change refactoring