Many rental apartments in New York City have hardwood floors — and they look nicer (and cleaner) than carpet. However, over time they can wear out and become a hazard.

If your hardwood floors are severely damaged, meaning they are cracked or splintered or causing other safety issues, your landlord is required to repair them under the guarantee of habitability, says Steven Kirkpatrick, a partner at law firm Romer Debbas. Your lease should also state what your landlord is responsible for, Kirkpatrick says.

However, if the floors are only damaged in one area, don’t expect your landlord to refinish or repair all the floors in the apartment, Kirkpatrick says. It’s acceptable for your landlord to only repair the portion of the floors that are damaged, and it doesn’t necessarily have to be the exact same floor, as long as it’s a reasonable type of patch.

[Editor’s Note: Realty Bites tackles your NYC rental questions. Have a query for our experts? Drop us an email. We respect all requests for anonymity.]

When it comes to refinishing hardwood floors, it’s usually done to remove deep scratches and dents, according to the National Association for Wood Floors. Your landlord may consider this as cosmetic damage.

If the problems are purely cosmetic, it may be harder to get your landlord to fix them.

But if you’re a long-term renter, it’s worth asking. There are also some products such as: Elmer’s Woodfiller ($7 on Amazon) that help fill cracks and remove surface scratches.

If all floors need to be replaced, you may have to leave the apartment for a few days, especially if they are replaced in every room. If your landlord asks you to leave, they have to pay for the move, Catharine Grad, a lawyer at Grad and Weinraub, previously told Brick. That could be an empty apartment in your building or a hotel, she says.

Refinishing and replacing floors is a messy process, so be sure to cover your belongings or set up a tent to protect them from dust and debris while the work is done.