 Its success resulted in the addition of more confederates, increasing the number of cantons to thirteen () by 1513.The confederacy pledged neutrality in 1647 (under the threat of the Thirty Years' War), although many Swiss served privately as mercenaries in the Italian Wars and during the Early Modern period.After the Swabian War of 1499 the confederacy was a "de facto" independent state throughout the early modern period, although still nominally part of the Holy Roman Empire until 1648 when the Treaty of Westphalia ended the Thirty Years' War.