As in the West, Gothic architecture gained popularity in Poland, mostly due to the growing influence and wealth of the Church and the towns which became major sponsors of this new style. Coupled with the significant economic development that occurred during the reign of Casimir III the Great, this resulted in a major transformation of Polish landscape, as hundreds of Gothic buildings rose throughout the country. The cathedrals of Kraków, Wrocław, Gniezno, and Poznań in Gothic style were built or rebuilt in the new style, as were hundreds of basilicas and churches, such as the St. Mary's Church, Krakow and the Collegiate Church in Sandomierz. Gothic secular buildings such as city halls also became numerous, for example in the new towns of Kazimierz and Wiślica. Casimir also invested in improved defenses. City walls, other town fortifications and standalone castles were raised. Casimir ordered the construction of least 40 new castles, guarding strategically vital areas and communication lines—they were so numerous that there is an Eagle Nests Trail in modern Poland). Cracow Academy received its seat, the Collegium Maius.