If Republican efforts to repeal and replace Obamacare are successful, one of the biggest winners would be the wealthy.

The Senate's bill -- released this week -- differs in key ways from the House-passed version. But proposals eliminate the taxes imposed on high-income Americans to help pay for an expansion of health benefits under the Affordable Care Act. The legislation also would let people contribute more to certain tax-advantaged accounts.

At the same time, both bills are expected to disproportionately hurt lower income households by reducing funding for Medicaid and offering less generous subsidies to buy health insurance.

Here are the key provisions under the Senate and House health bills that would benefit the highest-income households.

Eliminate Medicare surtax on wages

High-income earners currently pay the 1.45% Medicare payroll tax on wages up to $200,000 ($250,000 if married). But then they pay an additional 0.9 percentage points -- or 2.35% -- on wages above those levels.

Under both the Senate and House bills, that surcharge goes away in 2023.

Get rid of Medicare tax on investments

In addition to the surtax on wages, high-income earners making more than $200,000 ($250,000 if married filing jointly) are subject to a 3.8% Medicare tax on a portion of their investment income, which is determined by formula. Investment income includes money from capital gains, dividends, interest, rental income and annuities.

Related: Who gets hurt and who gets helped by the Senate health care bill

The Senate and House bills would eliminate this so-called net investment income tax and make the repeal retroactive to Jan. 1, 2017. In other words, if you sell -- or have already sold -- any stocks this year that have big long-term gains, you would not be subject to the surtax when you fill out your 2017 federal tax return next spring. You would pay a 20% tax rate on all of your gains instead of 23.8% on some of them.

Effectively, making it retroactive simply rewards people who happened to have sold their stock already.

"You're not affecting behavior at all. It's just a tax cut for high-income people," said Mark Mazur, director of the Tax Policy Center.

Related: What's inside the Senate Republican health care bill

Make tax-advantaged accounts for health costs more generous

Today, individuals can save up to $3,400 and families can save up to $6,750 tax free in a Health Savings Account. The Senate and House bills would raise that limit to the annual out-of-pocket maximum for high-deductible plans. For 2018, that would be $6,650 for individuals and $13,300 for families.

The legislation also would eliminate the caps on contributions to tax-deductible flexible spending accounts. Right now, employed individuals may each save up to $2,600 a year, so a two-earner couple can put away $5,200.

Raising or eliminating contribution limits on tax-advantaged accounts disproportionately benefits the highest-income Americans because they're in the best position to sock away more money.

The bills would also end the Obamacare prohibition on paying for over-the-counter medications with funds from tax-advantaged health accounts. And they reduce the penalty from 20% to 10% -- which was the pre-Obamacare levy -- if funds from an HSA are used for non-medical purposes. These provisions would take effect in 2018.