 The 10th century "Denkard" refers to the high-priest Tansar, who, in legend, is attributed with the collation of the Avesta, as "hērbad".Following the collapse of the Sassanid state in the 6th century, after which Zoroastrianism began to be supplanted by Islam, the increasingly impoverished Zoroastrian communities found it difficult to support a priesthood known only for their scholarship.By the 9th century, there was an active rivalry between these scholar-priests and ritual priests, with each group underbidding the other in their attempts to secure an income.