One of the hardest decisions in an entrepreneur’s life is knowing when to call it quits. While most people go into a business thinking about their measure of success, they don’t fully define the boundaries they are willing to accept to reach it.

50 percentof businesses fail within fiveyears, and 96 percentfail within 10 years. If you knew your company was one of those 96 percentdestined to fail, wouldn’t those years have been better spent working on something that hada chance of being in the fourpercent?

I’ve been on both sides of the spectrum. I was a foundingemployee at Evernote, which is is 10 years in and still going strong.My company before that folded in only two years after not being able to find it’s market.

Obviously, if we knew at the outset that a business was going to fail, we would never start. It is only through our action–or inaction–that they succeed or not. That said, when it comes time to evaluate your company, you should be as analytical as possible–as many people stay with their projects out of emotional attachment.

Here are some factors that you may be able to overcome:

  • If there are team disputes or advisor issues.
  • If you have cashflow problems.

In my experience, these seem the most difficult, especially when you’re going through them. However, you can always work through team problems with coaching or even by replacing people, and there are always ways to find money — if the product is sound. At a few of my companies, we bootstrapped for years until we got our first big clients or sources of funding.

Here are some factors that may lead you toward shutting down:

  • If the core intellectual property of your company is owned by another person or company that you don’t control.
  • If you’ve been unable to find a fit for your product within the market, even after pivoting.
  • If you have legal issues.

As a side note, if it is passion or focus related, and you’re still at a pre-traction phase, then you may as well quit right now. After all, if you aren’t passionate about your own project, then how can you expect your team or your customer to be?

If you do decide to shut down your business, here’s the course of action I recommend:

Get emotional.

Write down what is going on in your head about the business on paper. Write the reason you started it, the good things about it, the bad things, and the situation that brought you to the point of shutting it down.

As a general practice, I keep a journal where I capture my daily highs and lows, so when I look back later I can be objective over the positives and negatives of any venture I am involved in. When it dips too much into the negative for too long, it’s time for me to leave.

Be prepared.

Gather any contracts, bank statements, legal documents, invoices and any IP, and anything else you may have and read through them carefully. Find out what your current obligations are, if any, and to whom.

During the acquisition of a company I was previously involved in, the sale hit a snag because one of the creditors had a conflict of interest with the new buyer. It took months to sort and caused operations to shut down in the meantime.

Open the lines of communication.

If you have any partners or co-founders, discuss your intentions and the reasoning behind it. If you’ve decided to completely dissolve the company, lay out the division of ownership with supporting documents. If you’ve decided on a buyout, have the offer in writing.

While advising one company, I found that all three co-founders had their own individual reasons for wanting to shut down, but they had not spoken to each other about it. Simply having them discuss it with each other led to a new beginning for everything.

Be courteous.

Shut down any websites and applications you have launched, and make sure you notify any customers you may have of the end date and offer them a transition plan. After all, this likely won’t be your last venture, so you want to keep them on your side.

At one of my former companies, when we discontinued a game, we sent notice to the players months in advance — and gave them full, free access to the game as an open-source project.

Lastly, don’t quit being an entrepreneur forever. Remember to fail fast and learn from your mistakes in order to find yourself in the ranks of the successful 4 percent.