“I refinanced my mortgage about three years ago but rates are even lower now. I read that the Federal Reserve is expected to raise rates again this year. Is it too soon for me to refinance again? How can I tell if it is worth it?”

Mortgage rates could inch higher this year now that the Federal Reserve has a brighter outlook on the U.S. economy.

But there’s really no knowing what mortgage rates are going to do. Economists expected at the start of the year that rates would rise, only to watch them fall on concerns that China would drag down the global economy. They sank again in June after Britain voted to leave the European Union.

As with any financial decision, the choice should come down to how much it’s going to cost you versus how much money you can save.

To do this, you’ll need to calculate what’s called the break-even point, or how long it will take for your savings to be greater than your closing costs, says Katie Miller, vice president of mortgage lending at the Navy Federal Credit Union in Vienna, Va.

Take the example of someone saving $500 a month by refinancing, but spending $10,000 in closing costs to lock in that lower rate. That person will need to be in the house for at least 20 months before the total savings seen from the lower mortgage payment are greater than the closing costs. “You just need to make sure you’re in the home long enough to make it worth it,” Miller says.

Generally speaking, the steeper the drop in interest rates and the lower the closing costs, the sooner you’ll reach the break-even point.

A common rule of thumb is that the savings from refinancing will generally make sense if it will bring down the interest rate by at least 1 percentage point. But some people might still see substantial savings with a smaller interest rate change, depending on the size of their mortgage, their closing costs and other factors, Miller says.

With interest rates expected to rise eventually, homeowners who purchased their homes more than three or four years ago may at least want to do the math to figure out if refinancing makes sense for them, says Debbie Gallant, a financial planner in Rockville, Md.

There are a few other factors to consider. Homeowners should think about how refinancing will affect the length of their mortgage loan. People who refinance into a new 30-year mortgage are essentially restarting the clock and could end up making mortgage payments for a longer period than initially expected, Gallant says. For instance, a homeowner who planned to pay off his mortgage before retirement might not meet that goal if he refinances too often, she says. Similarly, people who switch to a shorter-term mortgage loan may pay less interest but could face larger monthly payments.

Some people may want to refinance to change the type of loan they have. For instance, those with adjustable-rate mortgages that may become more expensive if interest rates rise may be able to lock in a lower rate for longer if they refinance into a fixed-rate mortgage, Gallant says.

Still, homeowners shouldn’t feel rushed to make the decision. Even though mortgage rates increased slightly last week, they are still pretty low by historical standards. And if the economy continues to grow slowly, the Fed will move slowly too.

Read more: