Costs for New Boiler, then costs to Fix it right

During the 2021-22 winter here in Boston, the Boiler at my multifamily went kaput.  This is an investment property for my wife and I, and for our son.  We own 50%, he owns 50% and lives in one of the two units.  This is not germane to my question, but I thought I would set the scene.

 

This was right after Christmas and during the pandemic.  Every HVAC contractor I reached was booked for this kind of work, out 4-5 weeks.  I finally found a small outfit who could start in a week.  So they ordered the new boiler and I bought space heaters for the tenants and we waited.  The new boiler was delivered but the contractor didn't have the right gear to move the 1,000 pound boiler into the basement.  Couple of weeks later his crew managed to install the thing.  Sort of.  Cost was a little over $11K.

 

But the thing banged like crazy when it was heating up, and everyone complained.  At this point the contractor completely ghosted me.  I found another contractor, this one reputable, and his crew came in and re-piped the thing, and everything was fine.  Cost:  almost $7K.

 

So I'm doing the taxes for the place, and I assumed that all $18K should be added to the property's basis and depreciated.  But then I read something about "betterment" that seemed to be suggesting that costs that make systems better must be capitalized while costs that just fix stuff can be expensed.

 

Opinions?