Reorganize password_reset code