The majority of the caves are "vihara" halls with symmetrical square plans. To each vihara hall are attached smaller square dormitory cells cut into the walls. A vast majority of the caves were carved in the second period, wherein a shrine or sanctuary is appended at the rear of the cave, centred on a large statue of the Buddha, along with exuberantly detailed reliefs and deities near him as well as on the pillars and walls, all carved out of the natural rock. This change reflects the shift from Hinayana to Mahāyāna Buddhism. These caves are often called monasteries.