The newly conquered territories were administered until 1821 by the Viceroy of New Spain (Mexico), who in turn was subject to the authority of the Council of the Indies (Consejo de Indias) in Madrid. The decrees and laws promulgated by the Council were brought together in the code known as the Recopilacion de las Leyes de los Reinos de las Indias. But Mexico was a long way away and Madrid was at the other end of the world, and the Governor had power to set aside the royal orders if he considered them inappropriate to the local situation. The Audiencia or Supreme Court, the constitutional organ of the Philippines, had no means of enforcing its decisions. The excessive autonomy and centralization of power, at the level of both the gobernador (governor) and the provincial authorities (the encomendero, later replaced by an alcalde mayor) sometimes gave rise to abuses. For in fact the encomendero was all-powerful, holding political, judicial, financial and military authority; and in addition the alcalde mayor enjoyed until 1844 a quasi-monopoly of trade. At the municipal level authority was exercised by the gobernadorcillo, who was relieved of all taxes and service obligations but had to meet administrative costs much higher than the value of these privileges. In effect he took over the functions of the datus of the pre-colonial period. The office was at first hereditary, but the gobernadorcillo later came to be elected by an electoral body composed of local notable or principalia, datus and headmen of barangays. Towns were administered by a town council (cabildo); the first such towns were Manila, Cebu, Nueva Segovia (Cagayan) and Nueva Caceres (Camarines).