One of my big mistakes with Sifter was a strongly-held belief that I’d never sell the business. By itself, that wasn’t a huge problem, but in hindsight it was naive. It’s impossible to foresee the kind of life changes that might lead to selling a business. Don’t build a business just for the exit, but recognize there’s a huge intersection between the tasks and infrastructure that are good for selling a business, and the tasks and infrastructure that are good investments for running a business.

it’s no surprise that investing in your business pays dividends regardless of whether you sell, but knowing that should help you gain the right perspective so you can make time for what I’ll discuss here.

If you’re even remotely thinking about selling, do yourself a favor and start preparing at least six to twelve months in advance. You’ll significantly improve the value of your business and make it much easier to transfer to a new owner. However, don’t do anything you wouldn’t do if you weren’t selling. Invest in good decisions to improve the business that benefit you (if you end up not selling) or that benefit the new owner (if you do).

Talk to a Broker

Talking to a broker won’t do you much good if you’re not currently considering selling, but if you’re even remotely thinking about it, you don’t have anything to lose. While I’ll lay out some standard advice about selling a business, every business is unique, and a good broker can help you see the strengths and weaknesses of your specific situation.

While they take a percentage of the sale price (usually 10–15%), a good broker’s expertise helps you get a higher total valuation for the business by saving time, presenting the business in its best light, and reaching more buyers.

More importantly, if you plan ahead, talking to a broker can help you identify the areas where your business could improve before listing. Then you can create a timeline and a plan to prepare your business, and strengthen key areas before listing it. If you wait too long and you end up in a hurry, you might rush and be forced to sell your business at a lower value.

Be entirely honest and transparent with your broker. Selling is a long process, and eventually everything will come out in the open. Sugarcoating things will only lead to unrealistic expectations on your part, and the longer it takes for the truth to come out, the worse the impact on your ability to sell the business.

In fact, the facets of the business you’re reluctant to share are likely to be precisely the areas you need to spend some time improving if you want to sell successfully. If your broker doesn’t know about those issues, they can’t advise you on how to fix them.

Get Your Books in Order

One of the most common and tedious mistakes with business lies with poor bookkeeping. Sometimes it’s just neglected, other times it’s entirely non-existent. Regardless of any plans to sell, healthy books are critical. Hire a bookkeeper to help you stay on top of things, and hire a certified accountant to handle your taxes.

If you’ve neglected your bookkeeping, it’ll take some time to correct, but it will be drastically easier to write up an accurate prospectus for a buyer. An added bonus is that having your finances in order will help you identify and cut costs that aren’t entirely necessary.

Sifter was comfortably profitable, and while I was mindful of spending, there were certainly some luxuries we spent money on. These all made the business look less profitable and generated a slew of questions that could have been avoided entirely.

Write Good and Maintainable Code and Systems

Code quality and documentation are priceless even if you never sell the company. Writing, documenting, and testing your code helps everyone–particularly “future you.” Documentation makes revisiting old code much easier. It facilitates training new team members: you can spend less time bringing them up to speed, and they can become productive faster. If you sell, it pays off in terms of a higher valuation, and it makes transferring the business more straightforward.

When I sold Sifter, I documented code quality in a mad rush over the course of a week, and I was kicking myself the whole way. There were plenty of tasks I performed regularly but still didn’t know by heart. Documenting not only helped me remember them, but it uncovered opportunities for improvement. By waiting until we sold, the buyer was the only one who benefited. Think of all those years I could have been much better off!

Every team cuts a corner here and there, some more than others. Regardless of your situation, the more you bolster a good clean codebase with great test coverage, the easier everything will be. The sale will go more smoothly. You’re likely to get a better valuation, and you’ll spend fewer hours on things like supporting the new owner and transitional education after the transfer.

Get concrete metrics on the quality of your codebase. Things like test coverage and Code Climate (or other static analysis tools) can be very beneficial when it comes to providing tangible measurements of how good your code is. They won’t be the only stats buyers will look at, but they’ll help.

Have a solid provisioning and release setup. A reliable deployment and server provisioning process falls under the category of a good clean codebase, but it’s important enough to call out separately since release management is frequently one of the messier processes a team carries out. Make sure that it’s simple, resilient, and fully automated.

Document Your Processes and Systems

In addition to code and processes around code quality, you also have business processes with varying degrees of documentation or automation, like bookkeeping or managing refunds. You know how to do it, but the time will come when you’ll have to train someone else. The less dependent the business is on knowledge that exists only in your head, the higher your valuation will be–and the less painful it will be to transfer the business.

What kinds of processes can you document? Support, refunds, trial extensions, and basic bookkeeping are great places to start. Keep a running list of your vendors, including how you use them, their importance to the business, key contact information, pricing, and relevant documentation. Newsletters are also great for documenting.

As a small business, it’s easy to think that spending time documenting tasks and keeping code and paperwork organized isn’t really necessary. However, if you never invest in keeping operations streamlined and well-documented, you may be stuck between a rock and a hard place if you ever want or need to sell the business. The upside is that virtually every task that will make it easier to sell the business will also make it easier to run your business, as well as hire new team members. Take time to invest in great operations from day one–you’ll never regret it.