 As the city grew the city walls were moved, so the defensive function of the castle became less important and apartments began to be built in its interior, which was by now considered an annex to the court palace.From the time of Ercole I d'Este on, there are many records of construction of apartments, and of their enlargement and enhancement.The definitive transformation works were ordered by Ercole II after a fire in 1544, which had damaged the previous accommodation.