refactored authenticate_user method into User Class