After a fun meal with a big group at a restaurant, it’s the last thing you want to deal with — how to split the check.

The etiquette and the math often prove baffling. Should the whole table divide the bill evenly if only a few ordered liquor? Who pays for the appetizers that some people ate, but not all? What if the restaurant places a limit on how many credit cards it will take?

The divvying-up process can damage friendships, as there’s always someone who feels forced to pay more than they should.

Even if there’s agreement on how to divide the check, other problems can arise with a big party. The inputting of multiple credit cards is time-consuming for serving staff, which has other tables impatiently waiting for orders to be taken.

“I once split a check 18 ways,” former server and steak house manager Kaitlyn Doherty said. “The splitting is not the issue, as long as you know in advance. It’s the running 18 credit cards that takes 10 to 15 minutes, and waiting 10 minutes when you are ready to walk out the door can ruin the end of a lovely experience. I also never carried 18 pens. I have all the horror stories.”

There are ways to ease the tensions.

Here are some strategies for carving up a large restaurant bill to minimize stress on wait staff and prevent fights among tablemates. Each will take some advance planning, but the effort will be worthwhile to ensure a satisfying dining experience and no hard feelings among friends.

Plan ahead

Start a pre-dinner texting group and discuss how to handle upcoming scenarios. Does the group want to divide the bill equally or get separate checks for each person/couple? Should the drinkers pay for their alcoholic beverages? How should shared appetizers and desserts be split? Expect a lively discussion to ensue, but hopefully it will be over before you arrive at the restaurant.

Ask the restaurant for its rules

Some place a maximum on the number of credit cards they will run.

Share your plan with your server

As soon as you’re greeted by a waitress, point out the people who will be together on one check. That way, when the orders are written, the waitress can begin to take them in a way that will make splitting the final bill easier.

Sit next to the person on your check

This will make it easier on the servers to remember who’s with whom as they assemble the final tab.

How big should the table get?

Some recommend limiting the size of your dining group to make it easier to calculate the bill. Four is optimal, six max, some say. With a smaller group, splitting the check in half or thirds could also work.

There’s an app for this

Download Splitwise, Splid or Tricount, which can track expenses among friends, calculate who owes what, and allow them to settle up.

Use a single card

In this scenario, one person is willing to front the full tab and get paid back by fellow diners. This is the best way to get out of the restaurant speedily and is easiest on the wait staff.

And there’s a reward: That credit card will get lots of points that night that can be used toward travel or the group’s next outing.