While most borrowers look to refinance their mortgage when refinance rates fall, there might be other cases for swapping your loan, too.

For many borrowers, it’s best to refinance when you can lower your interest rate and plan to stay in your home long enough to recoup the refinance closing costs.

Bill Packer, chief operating officer of reverse mortgage lender Longbridge Financial, outlines a trio of factors to consider:

The after-tax monthly savings (new payment compared to old payment, after any tax-favored treatment)

The amount of time you intend to be in the home

The cost of obtaining the new mortgage

Once you know these three things, you can calculate your return to see if it’s positive, Packer says.

Let’s say you took out a 30-year mortgage for $320,000 at a fixed interest rate of 6.23%. The monthly payment totals $1,966, and over the life of the loan, you’d pay $707,808, which includes $387,808 in interest.

Say five years later, rates drop to 5.82%. At that point, you’d have $299,842 remaining on the original loan. If you were to refinance to another 30-year loan at that lower rate, your monthly payment would total $1,763 — about a $200 savings. Over the life of the loan, you’d pay $334,893 in interest, saving you $53,000.

The amount you can save by refinancing depends on several factors beyond rate, however, including your closing costs and whether you’ve chosen the right kind of refinance for your needs.

You won’t begin to realize savings until you reach the breakeven point: when the amount that you save exceeds the closing costs.

To determine the breakeven point, divide the closing costs by the amount you’ll save each month with your new payment. If you don’t plan to stay in your home that long, refinancing might not make sense.

Key reasons to refinance

Lower the interest rate: If mortgage rates have dropped since you first obtained your mortgage, a rate-and-term refinance can provide you with a lower rate (assuming you qualify). Ideally, that rate should be one-half to three-quarters of a percentage point lower than your current rate.

You might also qualify for a better interest rate if your credit score has improved since taking out your current loan. The best rates go to those with a score of at least 780.

Shorten the loan term: You can also refinance to shorten the time it takes to repay your loan. If you have a 30-year mortgage, for example, you might want to refinance to a new 15-year mortgage. Ideally, you’d get a lower interest rate and lower monthly payments with the new loan, but it depends on prevailing rates and your remaining loan balance.

Change the rate structure: Along with lowering the rate or shortening the term, some borrowers refinance from an adjustable-rate mortgage (ARM) to a fixed-rate loan. The former gets you out of variable-rate monthly payments and into a fixed monthly payment, which could make it easier to budget for. On the flip side, switching a fixed-rate loan to an ARM might allow for temporarily lower payments until the rate adjusts.

Pay for large expenses: You can do a cash-out refinance to tap your home’s equity for ready money. You can use these funds for any purpose, such as:

Lowering or paying off high-interest debt

Renovating your home

Paying college tuition

Investing in property

Eliminate private mortgage insurance (PMI): If you have a conventional loan and your home’s value has increased, you could refinance to get out of paying private mortgage insurance (PMI) right away, or at least earlier.

Is refinancing worth it?

If it frees up money in your monthly budget, reduces the overall cost of the loan or helps you achieve some other financial goal, refinancing can be well worth the work and money.

“It’s important to determine your breakeven point,” says Linda Bell, senior writer for Bankrate. “Remember that refinancing has costs just like a regular mortgage. While your goal might be a shorter loan term or a lower interest rate, if you plan to sell your home in a few years, it might not make financial sense. Make sure the benefits outweigh the costs.”