The cathedral is trinavel in construction and surrounded by side-chapels, added in later centuries. The earliest of these chapels were built off the chancel; St Margarita's chapel was consecrated (today it acts as a sacristy) in 1322 and few years the chapel, later to be known as the Báthory Chapel, was completed. The cathedral's west entrance is flanked by two chapels; one dedicated to Queen Sophia (last wife of Władysław II Jagiełło) and the second to the Holy Cross; these were built during the reign of Casimir IV Jagiellon (1440–1492); the former is notable for its polychrome vaulted ceiling. From the close of the 15th century, a further nineteen side-chapels were built or rebuilt.