Piracy was a matter of individual crime, while corsairs had the support of a state. During the 16th and 17th centuries, corsairs from the Maghreb and the Ottoman Empire made frequent attacks, and towns were sacked and trade interrupted. The Catalans also set up their own privateers. Towns built themselves watchtowers and defensive walls, and lookout towers were also built adjoining many farmhouses. The number of galleys constructed increased. Some, such as the Sant Jordi, were run by the Generalitat to keep a watch on the coastline.