After returning to Japan, Kūkai collated and systematized all that he had learned from Huiguo into a cohesive doctrine of pure esoteric Buddhism that would become the basis for his school. Kūkai did not establish his teachings as a separate school; it was Emperor Junna, who favored Kūkai and Esoteric Buddhism, who coined the term in an imperial decree which officially declared in Kyoto an Esoteric temple that would perform official rites for the state. Kūkai actively took on disciples and offered transmission until his death in 835 at the age of 61.