With credit playing such a huge factor in our financial futures, it’s no wonder we look for ways to maximize our credit scores. And a common strategy for building our credit scores is to pay off debt, which can help improve a credit score, especially if the cardholder is carrying a large balance.

It seems logical, then, to assume that the same strategy applies to other types of accounts — like a car or home loan, for example. And if you follow this theory, paying a loan off early might sound like an excellent strategy for building your credit score.

Unfortunately, paying off non-credit card debt early may actually make you less creditworthy, according to scoring models.

When it comes to credit scores, there’s a big difference between revolving accounts (credit cards) and installment loan accounts (for example, a mortgage or student loan).

Paying an installment loan off early won’t earn improve your credit score. It won’t lower your score either, but keeping an installment loan open for the life of the loan is actually be a better strategy to raise your credit score.

Credit cards vs. installment loans

Credit cards are revolving accounts, which means you can revolve a balance from month to month as part of the terms of the agreement. Even if you pay off the balance, the account stays open. A credit card with a zero balance (or a very low balance) and a high credit limit are very good for your credit score and will contribute to a higher score.

Installment loan accounts affect your credit score differently. An installment loan is a loan with a set number of scheduled payments spread over a pre-defined period. When you pay off an installment loan, you’ve essentially fulfilled your part of the loan obligation — the balance is brought to $0, and the account is closed. This doesn’t mean that paying off an installment loan isn’t good for your credit score — it is.

Paying off an installment loan though doesn’t have as large of an impact on your score, because the amount of debt on individual installment accounts isn’t as significant a factor in your credit score as credit utilization is. And while paying off an installment loan early won’t hurt your credit, keeping it open for the loan’s full term and making all the payments on time is actually viewed positively by the scoring models and can help you credit score.

There are a couple of ways that paying off an installment loan affects your credit score. The number of accounts you have that have balances is one factor in how your credit score is calculated. The more accounts you have, the more it will affect (and probably reduce) your credit score. And when you pay off a loan, you have one less account with a balance, which is typically good for your credit scores. The exception is never having had any accounts, which may hurt your score, because the credit bureaus then have nothing to base your credit history on.

Types of credit and length of credit history

Credit scores are better when a consumer has had different types of credit accounts, from auto loans and home loans to student loans and credit cards. It shows that you’re able to manage different types of credit and is good for your credit score.

Credit scores also like long credit histories and well-aged accounts. A common misconception is that when you close an account, it no longer affects your score. Not true. Scores take into consider the type of account and how long it was open even after an account is closed — the FICO Score and others factor both open and closed accounts when calculating your credit score.

Also see: Try these strategies if you’re going to retire with debt

Even though closed accounts do eventually fall off your credit report, closed accounts with late payments stay on your credit report for seven years. And if the account was in good standing and paid as agreed, it can stay on your credit report for up to 10 years.

Think twice about paying off a loan early

So, if you’re thinking about paying off an installment loan early, think again. Think about keeping it an open, active account with a solid history of on-time payments. Keeping it open and managing it through the term of the loan shows the credit bureaus that you can manage and maintain the account responsibly over a period.

Also think about other possible ramifications of paying off a loan early. Before paying off a loan or even making a few extra payments, take a close look at your loan agreement to see if there are any prepayment penalties. Prepayment penalties are fees that are paid when you pay off a loan before the end of the term. They are a way for the lender to regain some of the interest they would lose if they account were paid off early. The interest on loans is where the lender make its profit. And if you pay early, they don’t make any profit.

Paying off a mortgage loan early

Sometimes paying off your mortgage loan too early can cost you money. Before making those payments early or paying extra toward the loan each month to avoid a year or two of interest payments, there are a few common mistakes you want to avoid.

See: Take care about paying off the mortgage

First, if paying extra toward your mortgage each month, specify to the lender that the extra funds should be applied toward your principal balance and not the interest.

Always check with the mortgage lender about any prepayment penalties. These types of penalties can be a percentage of the mortgage loan amount or equal to set number of monthly interest payments you would have made.

Never pay extra toward a mortgage if you actually can’t comfortably afford to do so. Doing so is where the term “house poor” comes from. To help protect your credit score, always make sure you have money set aside for emergencies and only pay extra if you can afford to do so.

Paying off an auto loan early

If you’re looking to pay your auto loan off early, there are several ways you can do so. When paying your loan each month, it may be beneficial to add on an extra $50 or so to your payment amount, so you can pay the loan off in fewer months and pay less in interest over the loan term. If possible, specify the extra go toward the principal and not the interest.

You can also opt to make an extra larger payment each year to help you save on interest as well. Make sure though to not skip payments, even if your lender offers to let you skip one.

Repaying and paying off student loans

There are no prepayment penalties on student loans. If you choose to pay student loans off early, there should be no negative effect on your credit score or standing. However, leaving a student loan open and paying monthly per the terms will show lenders that you’re responsible and able to successfully manage monthly payments and help you improve your credit score.

Bottom line

Paying off a loan and eliminating debt, especially one that you’ve been steadily paying down for an extended period, is good for both your financial well-being and your credit score. But if you’re thinking of paying off a loan early solely for the purpose of boosting your credit score — do some homework first to ensure doing so will actually help your score. If paying a loan off early won’t help your score consider doing so only if your goal is to save money on interest payments or because it’s what’s best for your financial situation.

This article originally appeared on Credit.com.

Get a daily roundup of the top reads in personal finance delivered to your inbox. Subscribe to MarketWatch’s free Personal Finance Daily newsletter. Sign up here.