When going through a divorce, things can get messy when it comes to splitting up debt, credit and financial obligations. Even if a judge has assigned each person specific responsibilities, it’s possible one person will not uphold his or her end of the deal. The cold hard truth is that creditors don’t care what your divorce papers say—if you and your ex-spouse have a joint credit card account, you are both legally responsible for seeing that the debt is paid.

To protect your own credit score and ensure that the split goes as smoothly as possible, follow these five simple steps.

Split up joint accounts and stop charges on them.

The person that signed the credit card application is usually the owner of the account, and consequently the person who will be held responsible for the debt associated with it. If your spouse is listed as an ‘authorized user’ on the account, have his or her name removed immediately. This will prevent him or her from racking up excessive charges on the account.

The same goes for accounts where both parties signed the application and are considered equals. Both people are responsible for the debt. Call the credit card company and request a hold on the account so no additional charges can be placed on the card while you work to pay down the balance.

Pay off joint debt as soon as possible.

The sooner you can get rid of debt that has the name of both parties on it, the less hassle you’ll face down the road. If possible, pay it off even before you begin the legal process of divorcing. If you have any joint assets like homes or cars, one option is to use the cash from the sale of these items to pay off any remaining debt.

Take a close look at your credit report.

Look over your credit report with a close eye to find any accounts that are in the name of both you and your spouse, and close them. There’s a chance you may have opened a card or bank account together years ago and then forgotten about it, and this can come back to bite you later on. By closing all joint accounts, you’re protecting yourself and your good credit for the future.

Move balances to individual accounts.

If your ex-spouse agrees to take on responsibility for paying down a particular debt, transfer that balance into an individual account under his or her name. Even if the judge orders one person to pay off a debt, their word and signature aren’t guarantee enough. Protect yourself by making sure all debt assigned to the other party is moved to an account bearing his or her name only.

Eliminate loopholes.

Some lawyers suggest building provisions into their settlement agreements that prevent either spouse from getting out of their debts, even in bankruptcy. This eliminates the possibility that your ex can file bankruptcy and discharge your joint debt, leaving you responsible to pay it off.

The most important thing to remember when going through a divorce is the sooner you can get rid of your joint debt, the better. By following these tips and consulting closely with a lawyer, you’ll save yourself from financial headaches down the road.