A few years ago, a condominium owner in California phoned the company that had developed his home to complain about noise.

He said it sounded like the people in the fitness center next door were dropping their fifty pound weights and blasting the television in his living room, according to Josef Rodarti, who provided legal counsel to the developer.

Because homebuyers have the right to sue developers for construction defects, sometimes for as long as 10 years after the sale, a complaint like this can mark the beginning of a nightmarish trip through the legal system, said Rodarti, a development lawyer based in Aliso Viejo, Calif.

Busy judges sometimes encourage developers to settle by paying residents from an insurance policy. But if the claim turns into a class action lawsuit, even a settlement of a few thousand dollars per household could add up to a huge sum, prompting insurers to raise your premiums.

“If it goes to a lawsuit, they’ll want to make it the biggest problem west of the Mississippi,” Rodarti said. “That makes it a more valuable claim.”

Here are four simple steps developers can take to help fend off costly and time-consuming lawsuits from disgruntled condo buyers. Prevent problems before they start. Keep a checklist during construction of all the measures you can take to prevent the kinds of problems, from loud noise to moisture seepage to pest infestations, that spark complaints.

Provide adequate sound insulation. Check for cracks or holes that might provide entryways for pests. Avoid water leaks and poor ventilation. In one project, the ventilation fan required by the building code wasn’t enough to stop mold from growing in a linen closet foolishly placed in a humid bathroom. Hiring independent experts to double-check construction plans and inspect the building can help prevent mistakes like these.

Put it in writing. Include language in your condominium purchase and sale agreement requiring that any disputes over construction defects be resolved without a jury trial.

You can instead use what Rodarti calls “early neutral evaluation,” which requires the parties in the dispute to choose an impartial expert who will assess whether there is a construction defect and recommend a remedy. If either party refuses to accept the recommendations of the neutral expert, the problem can be sent into binding arbitration, a legally binding but less time-consuming alternative to a jury trail.

Use outside experts. Show the homeowner you’re making a good-faith effort to solve the problem by hiring an independent expert to evaluate the problem. Don’t send someone from your own development team, since your own people might not want to admit that they made a potentially expensive mistake, Rodarti said.

Look for cost-effective solutions. If you can find a fix that doesn’t involve tearing down and rebuilding big parts of your project, many residents—who probably don’t want to move out for months of demolition and construction—will agree to it.

In Rodarti’s California case, it turned out that that unit’s sound insulation was weak. The obvious solution was to tear out the wall between the fitness center and the condominium and rebuild.

Instead, the resident was satisfied by a combination of a little extra gypsum board in the walls, muted televisions in the fitness room, floor pads, and pads between the weights on the weight machines.

While it may be too late to practice prevention on some of your projects, don’t forget that a prompt response and a positive attitude when it comes to resident complaints can go a long way. And the faster you can fix the problem, the less likely it is to turn into a class-action nightmare.