Home-sharing service Airbnb has a tense relationship with its hometown of San Francisco, but the company says it’s been trying to please the city.

In particular, in an attempt to curb commercial operators, Airbnb has been limiting San Francisco hosts to only one property listing at a time, co-founder and CEO Brian Chesky said on Monday at the O’Reilly Next: Economy conference in San Francisco.

One of the biggest concerns from San Francisco officials—when it comes to services like Airbnb—has been that they can enable landlords to rent out homes on a short-term basis that would otherwise rent out to long-term tenants. This, in turn, opponents of short-term rentals argue contributes to the city’s current housing shortage.

The policy, dubbed “One Host, One Home,” has apparently been in effect in San Francisco since April, according to an Airbnb spokesman. The company says that it has removed San Francisco listings from its service that violate this policy, which it also applies to New York—another city where the company has run up against regulatory issues. According to a blog post from April, Airbnb says it intends on continuing to monitor for hosts who list multiple properties.

Get Data Sheet, Fortune’s technology newsletter.

One aspect of San Francisco’s short-term rentals regulations that remains unsolved is the limit on the number of nights per year hosts can rent out their homes. While the city has attempted to force Airbnb to police its own marketplace and remove listings that violate rules like its cap on the number of days hosts can sublet, the company has fought back in a big way: It filed a lawsuit against San Francisco.

“If you have a nights’ cap on one platform, they can start listing on another platform,” said Chesky on Monday, adding that it would only work if hosts could be somehow monitored on all home-sharing sites simultaneously. The company defeated a ballot measure last November that would have imposed even stricter limits on short-term rentals.

In its lawsuit against San Francisco, Airbnb makes several legal arguments, including that federal laws preclude the city from holding it accountable for what its users post on its website, but there’s also an economic interest in fighting the city’s demands.

If a host is barred from listing a property on Airbnb because he or she has exceeded the legal limit of nights, there’s nothing barring them from listing it through a different home-sharing service. Thus, Airbnb would miss out on the potential revenue. Unless the host can be monitored on all services, it’s in Airbnb’s interest for the home to be listed on its website, where it can potentially generate bookings (and revenue) even if it’s also listed elsewhere as many hosts do.

Airbnb recently threatened to sue the state of New York as well if Governor Andrew Cuomo signed into a law a recently passed bill that would impose steep fines on people who advertise short-term rentals that violate New York City’s laws, making much of the same legal arguments against the proposed new law.

At the same time, the company has also been experimenting with working with building owners and landlords who want to make home-sharing available to tenants. It recently debuted a program through which building owners can get more access to information about their tenants’ home-sharing activity.

“I’d prefer if they didn’t say, ‘Airbnb is a problem, how do we deal with it?’ but rather, ‘Airbnb is an opportunity, how can we harness it?’” said Chesky, whose company now operates in 34,000 cities in more than 190 countries worldwide.