edward i gave wide-reaching powers to the sheriff of yorkshire for enforcing law and order in the city of york, and the sheriffs established their headquarters in clifford's tower. during the wars against the scots under both edward and his son, york castle also formed the centre of royal administration in england for almost half the years between 1298 and 1338. many westminster institutions followed the king north to york, basing themselves in the castle compound. the existing castle buildings were insufficient to house all the administrative institutions; a temporary building inside the castle was built for the court of common pleas at the beginning of the period, and rebuilt on a larger scale during 1319–20. the exchequer took over clifford's tower. other buildings around the city had to be commandeered to absorb the overflow from the castle itself. as a result of the extended use of the castle for these purposes, the law courts at york castle began to compete with those in london, a pattern that lasted into the 1360s. the castle eventually acquired its own mint in 1344, when edward iii decided to create a permanent mint in york castle to produce gold and silver coins to serve the needs of the north of england. european coiners were brought to york to establish the facility.