changed set_password to update_password and other code cleanup