Some Shinto shrines became Buddhist temples, existed within Buddhist temples, or had Buddhist priests in charge. Buddhist temples were built, and Buddhist ideas were explored. The ruling aristocracy saw advantages in harnessing Shinto, Confucianism and Buddhism together to guide the people of Japan.