The count presided over judicial tribunals with the assistance of the "judices" (judges) and "boni homines" (good men) of the county. During the 11th century, Cerdanya became increasingly feudalised and drawn into the orb of Toulouse and Foix. The counts of Toulouse desired to control the pass of Pimorent () in Cerdanya, and those of Foix desired some control of the frontier with Moorish Lérida. The counts of Cerdanya, for their part, were interested in furthering their control of the church in the Midi and Catalonia; they had already controlled the important monasteries of Sant Miquel de Cuixà and Ripoll since the early 10th century. In 1016, they purchased the right to the archbishopric of Narbonne for 100,000 "solidi" for their relative Guifred and, not long after, that to the bishopric of Urgell as well. The famous Abbot Oliva was a member of the ruling dynasty of Cerdanya. When Count Raymond Wilfred plundered the Sant Miquel de Cuixà and entered into a feud with the Bishop of Elne, it gave the nobles opportunity to grant their services to whoever offered them the most advantage at the moment. In this period of political confusion, the viscount Bernard Sunifred rebelled. His lands were clustered in the north of Cerdanya, in the Segre valley and Conflent with their centre at Merencs. He put his lands under the nominal suzerainty of the count of Toulouse and tried to draw them away from Cerdanya. Bernard was forced to make peace with Raymond in 1047 and his allodial lands were handed over, though he was compensated with more fiefdoms from the count. Bernard rebelled a second time and was forced to make peace again in 1061. The important pass of Pimorent, which, now that Cerdanya was no longer a marcher territory, lay at the centre of its existence, remained in the hands of the Count Raymond and neither of Bernard's allies of Toulouse or Foix. The viscounts of Cerdanya and the others regions, like Conflent and Fenouillèdes, were the main antagonists of the comital power in Cerdanya throughout the 11th century. Briefly, William Raymond had to fight a war (successfully) with Giselbert II of Roussillon over the possession of the monastery of Cuixà, which Cerdanya had controlled throughout the 10th century, but in the main, the viscounts were the greatest military detriment to the counts of Cerdanya.