the sophists toward the end of the 5th century bce , a generation of itinerant teachers who came to be known as the sophists made a name for themselves through greeceespecially for their role in the evolution of the greek city-states from agrarian monarchies into commercial democracies .