Determined not to make the same mistakes as his brother, Afonso III paid special attention to what the middle class, composed of merchants and small land owners, had to say. In 1254, in the city of Leiria, he held the first session of the "Cortes", a general assembly comprising the nobility, the middle class and representatives of all municipalities. He also made laws intended to restrain the upper classes from abusing the least favored part of the population. Remembered as a notable administrator, Afonso III founded several towns, granted the title of city to many others and reorganized public administration.