The church was once the most powerful force in Europe, with the Pope being the highest figure in Western Christianity during the Middle Ages. Corruption in the church was rife during the Middle Ages, with priests collecting "indulgences" (monetary payments made by adherents to the Church, ostensibly to remove their relatives from Purgatory, but actually going to the construction of buildings and the coffer of the Papacy), Popes and cardinals engaging in political intrigues, some popes (especially Pope Alexander VI) engaging in highly immoral practices, and Popes calling crusades against non-Christians. The corruption of the old church led to the Protestant Reformation under Martin Luther in 1517, which shattered the Pope's control over Western Europe. The Holy Roman Emperors had already ignored the Pope's authority due to the Investiture Controversy and disputes over the leadership of Christendom, but the Reformation ensured that Catholicism itself would be at threat. Much of Europe converted to Protestantism or experienced Protestant unrest, especially Germany, France, England, and Scandinavia. Religious tensions led to the Dutch Revolt, the French Wars of Religion, the Thirty Years' War, and other conflicts, and the Popes were forced to begin the Counter-Reformation, reforming the Catholic Church in order to convince some converts to return to the Church. Since then, the Church's corruption has rapidly decreased, although child sex abuse cases during the late 20th century, the church's traditional stances against women's rights and homosexuality, and the involvement of the Church in politics have led to controversy in the church. Under Pope Francis, a Jesuit, the Church reinvented itself by returning to its original teachings of love and charity, and the church regained several members. By 2017, the church had 640 archdioceses, 2,851 dioceses, 221,700 parishes, 1,285,000,000 members, 5,237 bishops, 415,792 priests, and 44,566 deacons, and it was the largest non-governmental provider of education and medical services in the world.