At the close of the Middle Ages, the old confraternities which were generally confined to a town or small district gradually disappeared or preserved only a semblance of continuation. By the 19th century they were replaced by vigorous new associations, which, richly endowed with indulgences by ecclesiastical authorities, rapidly extended to the entire Church. In 1818, Pius VII endowed the "Archconfraternity of Our Mother of Sorrows and the Poor Souls in Purgatory", housed in Santa Maria in Trastevere, with rich indulgences.