Are fathers given unfair treatment in court when it comes to the custody of their children? Maybe.

Officially, judges aren’t supposed to let old-fashioned notions of gender roles influence their decisions about custody, but 80% of the parents with primary custody of their children are women. Many dads feel at a disadvantage when they seek equally shared or primary physical custody of their children.

So, what can a dad do if he wants to minimize his risk and get the judge to lean his way during a custody battle? Here are some pointers:

Track all of your financial contributions.

Ideally, make certain that your child support payments are withdrawn directly from your paycheck and funneled through the system. Any payments outside of the child support enforcement system should be done in a way that gives you a record — either by a receipt or a canceled check.

In addition, keep receipts for any other support. For example, if you pay a utility bill or provide school clothing outside of your normal support, keep the proof. You’re more likely to impress the judge as organized and responsible — and therefore capable of managing custody.

Get involved with your children’s lives.

Call, email or Skype your child daily, whether you can visit or not — and jot down important things you need to remember (like your son’s favorite dinosaurs and your daughter’s best friend’s name).

Keep your actual visitation dates sacrosanct. If you can’t keep a planned visit, communicate the problem — in writing — to your child’s mother and explain. Ask to reschedule and keep all the responses.

Be a visible presence at your children’s school events and medical visits. If you let their mother do all of the “heavy lifting” in public, that will play in court as if you are an uninvolved parent.

Build your relationship with your children and their mother.

The more you interact with your children and show an interest in their daily lives, the closer you’re likely to become.

It’s also important to try to bridge any distance between you and their mother. The court wants the parent with primary custody to demonstrate a willingness to foster a good relationship between the children and the other parent — so take the initiative, be flexible and be supportive.