The early coastal factory model contrasted with the system of the French, who established an extensive system of inland posts and sent traders to live among the tribes of the region. War broke out in Europe between France and England in the 1680s, and the two nations regularly sent expeditions to raid and capture each other's fur trading posts. In March 1686, the French sent a raiding party under Chevalier des Troyes over to capture the company's posts along James Bay. In 1697, Pierre Le Moyne d'Iberville, commander of the company's captured posts, defeated three ships of the Royal Navy in the Battle of the Bay on his way to capture York Factory by a ruse. York Factory changed hands several times in the next decade and was finally ceded permanently in the 1713 Treaty of Utrecht. After the treaty, the Hudson Bay Company rebuilt York Factory as a brick star fort at the mouth of the nearby Hayes River, its present location. The United States government sanctioned a factory system from 1796 to 1822, with factories scattered through the mostly territorial portion of the country. The factories were officially intended to protect Indians from exploitation through a series of legislation called the Indian Intercourse Acts. However, in practice, numerous tribes conceded extensive territory in exchange for the trading posts, as happened in the Treaty of Fort Clark in which the Osage Nation ceded most of Missouri at Fort Clark. A blacksmith was usually assigned to the factory to repair utensils and build or maintain plows. The factories frequently also had some sort of milling operation associated with them. The factories marked the United States' attempt to continue a process originally pioneered by the French and then by the Spanish to officially license the fur trade in Upper Louisiana. Factories were frequently called "forts" and often had numerous unofficial names. Legislation was often passed calling for military garrisons at the fort but their de facto purpose was a trading post. York Factory was founded by the Hudson's Bay Company in 1697. In the United States factories under the Superintendent of Indian Trade: