Nebraska’s Medicaid program can claim reimbursement from beneficiaries for skilled nursing room-and-board costs, the state’s high court ruled on Friday.

The case stems from a lawsuit filed by the estate of a nursing home resident who died in 2014. The Nebraska Department of Health and Human Services sought to collect almost $23,000 from the resident’s estate to cover nursing home services, including room-and-board costs, The Omaha World-Herald reported.

The resident’s estate argued that Medicaid funds couldn’t be collected to cover “non-medical expenses” like room and board, and the DHHS’ attempt to recoup the funds were “unconscionable and contrary to law.” The estate also claimed the state health department profited from collecting Medicaid funds.

In its opinion the Nebraska Supreme Court found “no distinction” between medical and room-and-board costs, noting that the resident had no dependents at the time of his death who could file a waiver to keep the funds. The court also shot down the estate’s claim that Nebraska’s Medicaid program was a “moneymaking scheme” as bordering on “frivolous.”

“The beneficiaries of a recipient’s estate are not entitled to an inheritance at the public’s expense,” Judge William Cassel wrote. “Because nursing facility services include room-and-board costs and other expenses, DHHS is statutorily authorized to recover the sums it paid for such medical assistance from [the] estate.”