In this early period, Japan was not a unified state; by the Kofun period it was divided among "Uji" (clans), each with their own tutelary kami, the "ujigami". Korean migration during the Kofun period brought Confucianism and Buddhism to Japan. Buddhism had a particular impact on the kami cults. Migrant groups and Japanese who increasingly aligned with these foreign influences built Buddhist temples in various parts of the Japanese islands. Several rival clans who were more hostile to these foreign influences began adapting the shrines of their kami to more closely resemble the new Buddhist structures. In the late 5th century, the Yamato clan leader Yūryaku declared himself "daiō" ("great king") and established hegemony over much of Japan. From the early 6th century CE, the style of ritual favored by the Yamato began spreading to other kami shrines around Japan as the Yamato extended their territorial influence. Buddhism was also growing. According to the "Nihon Shoki", in 587 Emperor Yōmei converted to Buddhism and under his sponsorship Buddhism spread.