Uber will eliminate upfront pricing for certain trips in California and let passengers book rides with their “favorite” drivers as the ride-hailing giant adjusts to the state’s new gig-worker law.

Those were among several changes Uber said it has made in response to the law known as AB5, which lays out a test for whether workers should be classified as employees or independent contractors.

“These changes may take some getting used to, but our goal is to keep Uber available to as many qualified drivers as possible, without restricting the number of drivers who can work at a given time,” Uber said in a Wednesday email to its Golden State riders.

The company said it will now show passengers a price range for rides that are not shared, such as its UberX service, instead of an exact fare. The final cost will be calculated at the end of a trip based on distance and time traveled, Uber said.

Meanwhile, passengers will also be able to pick “favorite” drivers whom they have given five-star ratings, according to the email. Those drivers will then get a chance to accept the passenger’s reservation the next time the person schedules a ride in advance, Uber said.

Uber has made other changes to its app to increase flexibility for drivers in response to the California law. The company has argued that it is only a platform that connects drivers and passengers rather than a full-blown transportation company.

While Uber will still pay drivers based on time and distance, the company will now cap its cut of the fare at 25 percent for UberX trips and 28 percent for its premium rides, according to a Wednesday blog post.

“We’re simplifying our fare structure to further clarify the relationship between you and your riders, and Uber’s role as a technology platform,” Uber wrote.

The company has also begun showing drivers the destinations and fares for trips upfront when they’re deciding whether to accept or reject rides. All California drivers will have that capability by the middle of this month, Uber said in December.

Uber and Postmates filed a lawsuit last month to block the California law, which aims to force app-based firms to pay their workers a minimum wage and provide benefits such as sick days.

The companies alleged that the law targets tech companies and their workers, who would no longer be able to make money on their own terms if the measure is enforced.