When you start a company, it’s you and your co-founder against the world. You will sacrifice everything to build your vision. Sleepless nights, forgoing a social life, letting your health go to crap, and even neglecting your own family are all on the table to achieve your dreams, but it’s going to be OK, because you are in it together. Together forever.

But what if it’s not forever? What if you sacrifice everything, and after two years your co-founder needs to find himself? What if his ego gets bruised, because you are the CEO and as the company grows he becomes less important? What if she develops a serious drug problem? What if she turns out to be not quite as talented as you thought? What if he likes partying more than working? What if “shit happens”?

Well, it can be OK, or it can destroy your company. It all depends on how realistic you are when you set things up.

Yes, breaking up is hard to do — whether in love or in business. But, at least in business, there are some things founders can do proactively to lessen the pain. Think of it as a common sense prenup to protect your company.

So, what can you do to help ensure that founder breakups don’t end your startup dreams? Here are some things to consider:

Founders understandably want to get full credit toward vesting of their founder shares from when they first conceived let alone began working on the new startup idea. As a result, by the time founders raise their first institutional financing round, they may be as much as 50% vested. However, with companies staying private demonstrably longer these days (11 years for the 2014 tech IPO cohort), the work required to build the business into a successful venture has only just begun.

We have seen many instances where a co-founder leaves — whether voluntarily or otherwise — once he or she has fully vested, leaving the other co-founder to bear the brunt of managing the business and building long-term shareholder value for many years to come. And, although the remaining co-founder may receive incremental refresher equity grants from the board over time for her continued service, the likely financial value of her new equity pales in comparison to the value of the fully-vested equity the former co-founder has realized.

The difficult conversation with the remaining co-founder is the same each time: ‘I’m here every day busting my back to try to build long-term equity value for my employees and investors while John is enjoying the celebrity party scene.’

So, what are your options?

Think about whether four-year vesting is still appropriate

This at least applies to founders — given the much longer runway most private companies will have before they get to their public market debut. Equity is intended to provide long-term incentives, so the question is whether the definition of “long-term” needs to change. The goal is to make sure that founder equity serves its purpose — to create long-term incentives — and that the economic rewards of success accrue to those (both remaining co-founders and key employees) who are disproportionately creating long-term shareholder value.

Consider the circumstances in which a founder can be removed

In most cases, founders have common board seats and, in many cases, the founders/common directors control the board. In those cases, the decision to remove a co-founder from the company can only be done with the agreement of the other co-founder. Those worried about VCs arbitrarily kicking founders out (or trying to screw founders out of equity) can use a structure like this while preserving the ability for only another co-founder to remove a co-founder that is no longer right for the business. (In fact, it is most often the co-founder, not the VCs, who has the ultimate decision.)

Avoid a situation where a co-founder is ‘ruling from the grave’

If you do make the decision to remove your co-founder from his executive role in the company, you don’t want him staying on the board and potentially interfering with the company’s ability to move forward. To deal with this situation, make sure that board seats are conditioned upon continued service to the company as an employee — not simply granted to someone as a function of them having been a co-founder.

Now, I know what you’re thinking — isn’t this just a veiled attempt by the VCs to screw founders out of their equity? That’s not what we are suggesting, nor consistent with what our experience has been as investors. These are co-founder splits, which as we noted above, generally can only happen cleanly with the consent of the other co-founder.

Transfer restrictions

Let’s say your co-founder has left but is now sitting on hundreds of millions of dollars in vested stock and wants to sell the stock privately, in the secondary markets. Meanwhile, you are trying to raise primary capital for your business, so your co-founder’s secondary stock is competing for that demand.

The best move here is to have instituted blanket transfer restrictions on stock sales from the founding of the company. A blanket transfer restriction means that shareholders cannot sell without some form of company consent, most often from the board. Your co-founder can’t sell under the above scenario unless given permission. But very few companies have such restrictions in place. What most of them do have is a right-of-first-refusal (ROFR) agreement, which essentially means that if someone is trying to sell, the company has a right to match any offers received. But this alone does not prevent co-founders from selling stock. Plus, in nearly all cases, the company does not want to use its cash for stock re-purchases vs. investing in growth opportunities.

This one is tricky, because you can’t just implement transfer restrictions at a later date and impose it on all existing shareholders. To implement transfer restrictions post-hoc requires consent of the shareholder, and you’re unlikely to get that because you’re asking them to give up a valuable right that they already have!

This is why you do it at the beginning. That is the time to get perfect alignment between you and your VCs for the journey ahead. Everyone is making the same covenant — we are all committed to creating long-term shareholder value, and we’ll all share in it (or not) once the company goes public, or the board agrees to provide some structured liquidity programs to former/existing employees. The keys here are “structured” and “orderly” — something only a blanket transfer restriction can provide.

Acceleration of vesting

In most cases founder stock vesting is tied to continued employment with the company. That’s the whole idea behind vesting: You contribute to the success of the company by helping to grow the business, and are rewarded — over a period of time — with an ownership position in the equity you helped create.

But, what happens when co-founders leave — should they continue to vest their stock or get their vesting accelerated? What if you sell the company while your co-founder is still there, but refuses to join the acquirer: should vesting accelerate?

No. There’s no need to provide for accelerated vesting on termination of employment, as long as you and your co-founder have agreed on the circumstances under which either can be removed (and you’re both comfortable that the decision to do so was governed by a fair and deliberate process). The sitting co-founder is better off having unvested equity return to the pool to reward those employees who are actively contributing to the long-term success of the business.

In the acquisition scenario, founders will often have single trigger or double trigger acceleration provisions. In a single trigger provision, the founder’s stock is accelerated upon the closing of an M&A event; in double trigger, both the closing of the deal and the acquirer’s decision not to retain the founder in the new entity are required for acceleration.

A single trigger is sub-optimal for the same reasons that accelerating vesting post-employment without an M&A event is — you are consuming equity for an individual who is no longer actively contributing to the success of the company. With a double trigger, the acquirer has removed that option for the co-founder, so it’s only fair that there not be a penalty of losing unvested equity.

From the perspective of the acquirer, single triggers can be costly if they want to retain the co-founder (ultimately impacting the total purchase price that the rest of the team receives in the deal). If the co-founder has the option to accelerate on a single trigger, the acquirer will need to offer additional cash/equity incentives to retain them. But there are no free lunches — that additional consideration must come from somewhere when the price pot for the purchase is fixed.

* * *

There is nothing we want more than to see companies be built by their founders, and for the long haul. But it doesn’t always go that way.

Startups are passionate, exciting endeavors — but they are still businesses. And when things go wrong between co-founders, as with most things in life, a little planning up front can mean the difference between a catastrophic vs. a merely painful outcome.

This article originally appeared in Fortune