cleaned up reset password, added alerts, refactored