Last year, the Ukrainian government recorded 1,833 operating state-owned companies, and another 1,700 that were standing still. These 3,500 companies do not yield any profits; instead, they cause the government vast losses. Any profit is stolen. Sensibly, the government focused on cutting losses and improving corporate governance in 2015. Now, this obsolete junk should be privatized.

Ukraine’s privatization discussion has dealt with a few major enterprises of great value—primarily, the largest fertilizer manufacturer, Odesa Portside Plant, and Centrenergo, the only remaining electricity-generating company—in the hope of reaping large state revenues. However, anything sold just after a crisis will be cheap. Any aspiration to yield large state revenues fast is unrealistic.

Instead, the first objective of privatization today should be to improve the functioning of the economy, freeing it from excessive state interference. Second, the pervasive corruption within state companies must be halted. Third, due to national security concerns, strategic infrastructure and key armament companies should not be sold. Fourth, the few truly valuable state companies should be sold when the economy has normalized and asset prices have risen.

Reports of corruption in major state companies are frequent in Ukrainian media. Normally, a state company buys inputs at too high a price from a trading company, often an anonymous firm in Cyprus. Then it sells its product to another trading company at too low a price. In that fashion, the whole profit is transferred to offshore trading companies. The principals in this dirty business are usually senior parliamentarians—so-called “gray cardinals”—who appoint the state enterprise managers on little legal ground and in collusion with party leaders, because they finance political parties.

This vicious circle of corruption has rightly become a major focus of Ukrainian reformers. The government has established independent supervisory boards and a meritocratic and independent selection process for the CEOs of many state corporations. The electronic procurement system ProZorro is supposed to hinder old-style transfer pricing. Parliamentarians’ legal obligation to reveal their incomes and assets is supposed to compel them to be honest. And the law on public financing of political parties and election campaigns should legalize political funding.

All these actions are laudable, but as long as many enterprises remain owned by the state, achievements are not likely to last. The next step must be privatization. Privatization cannot be done today as in the early 1990s, because conditions have changed. Voucher privatization or insider privatization no longer make sense.

Ukraine is a country full of factory ruins. Many enterprises stopped working in the early 1990s and never restarted. Today, most are obsolete and only valuable as real estate. In most European countries, such companies have been closed and demolished. In Ukraine, amazingly, the privatization of many of these ruins is prohibited by parliament.

Parliament has approved the privatization of 450 companies this year. That is good, but Ukraine has 3,500 state-owned enterprises: 1,700 are ruins, and 1,600 have operating enterprises that are just extracting subsidies from the state. They should all be sold off as fast as possible. The issue is not to maximize state revenue but to minimize state losses, cleansing the state from corrupting assets. At the same time, real private property rights need to be generated.

Successful small-scale privatization in many post-communist countries suggests how to proceed. For example in Poland, privatization took off when regional authorities took on executive responsibility and reaped financial rewards. Any enterprise privatization should be completed in one step, with simultaneous sales of all remaining state shares. Piecemeal sales of shares allow existing shadow masters to secure their control over an enterprise without competition. Such sales have rightly been prohibited by the recent privatization law. Nor should the state be allowed to retain any “golden share,” which is a persistent source of state interference and corruption.

The top one hundred state enterprises, mainly in energy and transportation, have real value. Their corporate governance needs to improve before their sales, which must be transparent and competitive, aiming both at high prices and sound restructuring. They should be open to foreign bidders whenever possible. Some sales could be carried out relatively soon—notably of ports, which should also lead to greater competition between ports and a reduction of the excessive costs of these services. Basic infrastructure, such as the trunk pipelines, electrical grid, and rails, will have to stay state-owned for the sake of national security.

Ukraine’s armaments industry has largely remained state-owned. About 120 armament companies belong to Ukroboronprom. This complex sector needs to be analyzed as a separate concern. In the end, most of its companies should be privatized as well. Motor Sich, the helicopter engine producer in Zaporizhe, is arguably the best Ukrainian armament company, and it is private.

The Ukrainian government should finally get out of the management of enterprises and instead create an open and level playing field with a minimum of bureaucracy and a maximum of transparency for all enterprises.

Anders Åslund is a senior fellow at the Atlantic Council in Washington and author of “Ukraine: What Went Wrong and How to Fix It.”