THE headquarters of the World Trade Organisation (WTO), on the banks of Lake Geneva, once belonged to the League of Nations. That ill-fated body was crippled by American isolationism. The building’s occupant today is also at the mercy of decisions taken in Washington.

President Donald Trump has circumvented the WTO to impose tariffs on steel and aluminium imports, including those from America’s allies. Complaining of unfair treatment, the administration is blocking nominations to seats on the WTO’s appellate body, which could leave it unable to hear cases after 2019. Most ominously, America is embroiled in a trade war with China. Both sides have imposed tariffs on goods worth tens of billions of dollars and are threatening worse.

The WTO was supposed to contain trade disputes and prevent retaliatory pile-ups. Today it appears to be a horrified bystander as the system it oversees crumbles. Free-traders are right to be deeply worried, but not yet right to despair. For the outlines of a plan to save the system are discernible.

It’s the end of the WTO as we know it

That might seem fanciful, given Mr Trump’s belligerence, but for two things. The first is that the president is not the only person forging American trade policy. The European Union and Japan have been talking to Robert Lighthizer, his low-profile chief trade negotiator, about WTO reform. Mr Trump’s tirades make headlines, but Mr Lighthizer wants to remake the WTO, not abandon it entirely. He could use the president’s threats as leverage to make deals. Think of it as a good cop/bad cop routine, albeit one in which the bad cop has only a faint grasp that he has been allotted the role.

The second thing to understand is that the focus of much of America’s ire, China, arouses deep suspicion elsewhere, too (see Briefing). Since joining the WTO in 2001, China has not turned towards markets, as the West expected. Instead, it has distorted trade on a scale that is far bigger than the dumping and other causes of disputes between market economies that the WTO was designed to handle.

The EU and Japan share America’s desire to constrain Chinese mercantilism. China’s state-owned firms and its vast and opaque subsidies have distorted markets and caused gluts in supply for commodities such as steel. Foreign firms operating in China struggle against heavy-handed regulation, and are required to hand over their intellectual property as a condition of market access.

But holding China to account is hard with the existing rule book. The reforms being talked about by the EU, Japan and America could plug many of the gaps. They would set out how to judge the scale of government distortions to the market, make it easier to gather information on wrongdoing and set the boundaries for proportionate retaliation. They would also define what exactly counts as an arm of the government, and broaden the scope of banned subsidies. And they would lower the burden of proof for complainants, which, given the opacity of the Chinese system, is too high.

Even the sunniest optimist will be able to identify the obstacles to this plan. Most obviously, why would China ever accept a reform that jeopardises its state-run economic model? Put plainly, because America could wreak havoc otherwise. It is in China’s interests to preserve the global trading order because, if China is isolated, the Communist Party cannot achieve the prosperity that cements its legitimacy. The benefits to China of its WTO membership have come not from lower tariffs in America—they were already low—but from the certainty of stable trading relationships. Its “Made in China 2025” plan to boost vital industries sounds threatening, but if China were obliged to produce everything at home, its time frame would be delayed by decades. Sure enough, China and the EU agreed on July 16th to co-operate on WTO reform (see article).

Reaching a global agreement that covered every one of the WTO’s 164 members would also be extremely difficult. The last big round of global trade talks stalled over demands by developing economies such as India for more leeway to protect farmers. New negotiations may be held hostage to these old disputes. Luckily, negotiators can skip around them if necessary, by securing a “plurilateral” agreement between a group of big economies. The WTO would still enforce the terms, though they would not apply to its other members.

Last comes the greatest block to a grand bargain, Mr Trump himself. The president is a fierce critic of the WTO and a believer that bilateral deals suit American interests better. This week he called the EU a “foe” on trade. If he thinks Mr Lighthizer is manipulating him, he will strike back.

And I feel slightly more upbeat than you might expect

A better idea than the Trump administration’s wrecking strategy would have been to unite most of the world around a set of rules in America’s interest, forming blocs so large that China would have had to choose between compliance and isolation. That was the idea behind both the Trans-Pacific Partnership (TPP), a pact from which Mr Trump withdrew within days of taking office, and also a stalled trade deal with Europe.

Wrecking strategies do not always fail, however. Sometimes they pay off handsomely. A WTO fit to handle complaints about unfair competition would be a gift to the world. The genius of the rules-based system is that it has torn down barriers by persuading producers that the prize of access to foreign markets is worth the accompanying global competition. When that competition is deemed lawless, political support for free trade withers. A world in which China is pursued by its critics through the WTO, and faces proportionate retaliation when necessary, is far preferable to one in which a tit-for-tat trade war can escalate without limit.

Mr Trump is hard to predict. He may yet abandon the WTO. If he does, other powers will probably go on building links and writing rules—witness the trade deal that the EU and Japan signed this week. But if Mr Lighthizer is able to present Mr Trump with an agreement that the president likes, the world trading system may yet be saved. It might even be improved.