In a recent study by the Employee Benefit Research Institute, data shows that “the percentages of families whose debt payments are excessive relative to their incomes are at or near their highest levels since 1992.” The report found that, as a result, “even more nearly-elderly and elderly families are likely to find themselves at risk for severe changes in lifestyle after retirement than past generations.”

The median outstanding mortgage balance for a 50 to 69-year-old household grew 142 percent in 20 years, from nearly $49,000 in 1992 to $118,000 in 2013, according to data from the not-for-profit Demand Institute. Yet some financial experts say paying a mortgage before retirement isn’t always the best strategy, even as boomers try to lessen their financial burden before they retire.

“A lot of baby boomers aren’t on track for retirement, and rushing to pay off a mortgage could be problematic for a lot of them,” said Thomas J. Anderson, author of “The Value of Debt in Retirement.” Instead, “having a portfolio of cash and conservative, globally diversified investments gives you liquidity and flexibility,” he said. Before refinancing into a shorter-term loan or making extra payments to pay off their mortgage, the focus may need to be on other financial areas.

Pay Off Credit Cards

Not all debt is “good,” Anderson said. If your goal is to be debt-free, he suggested first paying off any credit card and other high-interest debt. Paying bills on time and limiting using less than 30 percent of your available credit are also two ways to improve your credit score. An excellent credit score will help to ensure you get the best mortgage rate—if you do decide to refinance at some point.

Build an Emergency Fund

It is even more important to keep stashing money in an emergency fund in the years leading up to retirement. You want to have enough cash on hand so you’re not forced to dip into retirement accounts to pay for unexpected expenses in retirement. Having extra money on hand in the event of an emergency is more easily accessed and without the penalty of dipping into a retirement account.

Max out Retirement Savings

While you’re working, continue to put as much as money as you can into your retirement savings and get a tax break. If you’re 50 or older, you can make “catch-up” contributions to either a 401(k) or IRA, which will add thousands more dollars to your fund. With catch-up contributions, someone 50 or older can put up to $24,000 into a 401(k) in a single year and up to $6,500 in a traditional or Roth IRA.

For those who believe it is important to be debt free, you should consult a professional to find the best refinance mortgage rates before refinancing into a shorter-term loan or making extra payments to pay off your mortgage. If you decide to pay off your mortgage before you retire, funds from taxable accounts should be used first. Withdrawing from a retirement account will be taxed as income in the first year they are withdrawn and reduce savings on interest. The best strategy for each individual depends on the mortgage rate, as well as his or her goals and circumstances. Consult a financial professional to discuss your options.