With the end of the civil war, Henry's government faced the task of rebuilding royal authority across large parts of the country. By the end of 1217, many former rebels were routinely ignoring instructions from the centre, and even Henry's loyalist supporters jealously maintained their independent control over royal castles. Illegally constructed fortifications, called adulterine castles, had sprung up across much of the country. The network of county sheriffs had collapsed, and with it the ability to raise taxes and collect royal revenues. The powerful Welsh Prince Llywelyn posed a major threat in Wales and along the Welsh Marches.