Dozens of “dockless” bike-sharing startups have emerged in the past few years, offering apps where riders can locate bicycles, unlock them and leave them wherever their ride ends. The result in some Chinese cities has been more than a million bicycles piling up in public spaces, blocking entrances to buildings and public transit stops, and obstructing sidewalks. Not only is the situation disorderly, it’s dangerous: Discarded bikes can block pedestrians’ paths, causing them to trip or forcing them to walk in the road.

But the chaos may be coming to an end: New regulations aim to restore order to the city’s streets while still allowing bike-shares to thrive.

Chinese Cities Look to Regulate Dockless Bike-Sharing

In May 2017, China’s national-level Ministry of Transportation drafted the first country-wide framework for regulating dockless bike-sharing, issuing a formal regulation in August. Since then, nearly 30 Chinese cities have passed regulations to guide bike-sharing’s production, operation and maintenance, adhering to the national guidelines.

Shanghai claims to be the largest bike-sharing city in the world, with roughly 1.7 million bikes at the of the end of September 2017. The city drafted one of China’s first city-level bike-sharing regulatory guidelines in April 2017, issuing it in October. The guidelines push local authorities to integrate bike parking with city planning requirements. It requires operators, government officials and agencies to control the city’s bike fleet, such as by requiring bike plate registration, banning shared electric bikes, and guaranteeing more standardized parking by using Geo-fence technology, which uses a Bluetooth-based sensor to detect if bikes are parked in the proper area.

At the urging of these guidelines, Mobike and Ofo, China’s two biggest bike-sharing companies, have made more of an effort to remove bikes in poor conditions from the fleet and relocate bikes during peak use hours. As of the end of October, the total number of shared bikes in Shanghai had dropped to fewer than 1.1 million.

The regulations also protect consumers financially. The city appointed an independent financial institute to oversee bike users’ deposits, assuring that they’ll receive their money back if a bike-share operator goes bankrupt.

Bike-Sharing Challenges and Solutions Go Global

Shanghai’s regulations show a great level of versatility and detail in terms of management of cycling safety, fleet control, parking, maintenance and data sharing. Other cities are now following suit around the globe, such as Seattle.

Both Shanghai’s and Seattle’s regulations set a cap for the number of bikes allowed in the city. Seattle also required its fleet control to be carried out in phases, requiring operators to introduce no more than 500 bikes in their first month of operation, and no more than 1,000 by the second month. From the third month onwards, if an operator satisfies all of the city’s regulations, it can introduce more than 2,000 bikes, so long as there are fewer than 130 bikes in 1,000 square miles.

In terms of bike parking, the Seattle Department of Transport also suggested that dockless bikes should only be parked on the edges of the sidewalk or on a bicycle rack so as not to obstruct pedestrians. Bike parking is forbidden in certain areas, including narrow areas on the outer side of sidewalks, corners and more. If a dockless bike hasn’t moved for seven days or the bike is not parked standing upright, city workers will remove it and only return it to operators once they’ve paid a fine.

A More Orderly Bike-Share System

Everyone benefits if bike-sharing thrives. Bikes cost-effectively make cities more accessible for citizens, and can complement more traditional mass transport. They’re also vitally important in the global battle against climate change: About 70 percent of the world’s greenhouse gas emissions come from cities.

Bike-sharing’s evolution will be more orderly and effective with a balanced regulatory framework. Only through proactive regulation can urban bike-sharing systems flourish without jeopardizing public wellness.

This article first appeared on WRI Insights.

Hui Jiang is a Research Assistant, WRI China Sustainable Cities.