Starting in 1212, Afonso II of Portugal established the state's administration, designing the first set of Portuguese written laws. These were mainly concerned with private property, civil justice, and minting. He sent ambassadors to European kingdoms outside the Iberian Peninsula to begin commercial relations. The earliest references of commercial relations between Portugal and the County of Flanders document Portuguese attendance at Lille's fair in 1267. In 1297, with the Reconquista completed, King Denis pursued policies on legislation and centralization of power, adopting Portuguese as the official language. He encouraged the discovery and exploitation of sulphur, silver, tin, and iron mines, and organized for the export of surplus production to other European countries. On 10 May 1293, King Denis instituted the "Bolsa de Comércio", a commercial fund for the defense of Portuguese traders in foreign ports, He distributed land, promoted agriculture, organized communities of farmers and took a personal interest in the development of exports, founding and regulating regular markets in a number of towns. In 1317, he made a pact with the Genoese merchant sailor Manuel Pessanha (Pesagno), appointing him Admiral and giving him trade privileges with his homeland, in return for twenty warships and crews. The intention was the defense of the country against pirates, and it laid the basis for the Portuguese Navy and the establishment of a Genoese merchant community in Portugal.