Reinvention is a normal, healthy part of running a successful business. Pivoting, as it’s sometimes called, has slowly become a normal part of startup lexicon over the years. According to an Intuit study, 53 percent of companies were forced to transform their business since 2010 in order to survive.

Although it may seem like another word for failing, pivoting early enough can pay dividends for a business in the long run by allowing entrepreneurs to invest their capital in an idea more promising than their initial endeavor. A 2016 CB insights report analyzed 156 startups from across the country that failed in the previous year and found that some startups that didn’t pivot fast enough to stay viable eventually went out of business.

Keith B. Nowak, former CEO of now-defunct social media marketing company Imercive, is one of several entrepreneurs in the report who gave a candid account about how and why their businesses floundered.

“We stuck with the wrong strategy for too long. I think this was partly because it was hard to admit the idea wasn’t as good as I originally thought or that we couldn’t make it work,” Nowak said. “If we had been honest with ourselves earlier on we may have been able to pivot sooner and have enough capital left to properly execute the new strategy. I believe the biggest mistake I made as CEO of Imercive was failing to pivot sooner.”

Understandably, investors sometimes interpret a change in focus as a sign of trouble, but if done correctly, pivoting can be a sign of better things to come. One of the most famous – and successful – business transformations occurred when entrepreneurs Christopher ‘Biz’ Stone, Jack Dorsey and Evan Williams turned struggling podcast platform Odeo into Twitter. Originally, the entrepreneurs launched Odeo as a place where users could find podcasts, but soon faced stiff competition from Apple when it incorporated its own podcast platform into iTunes. Eventually, they decided to launch a new side project called twttr, which grew and later took off to became the multi-million dollar business it is now.

Blue River Technology—a startup that initially wanted to provide autonomous lawn mowers for large commercial spaces, like golf courses—is another company that successfully pulled off a pivot. Early on, the founders figured out that their target industry wasn’t lucrative enough after interviewing dozens of potential customers, very few of whom were either willing or able to pay thousands of dollars for robotic lawn mowers.

It was a setback that could’ve ended their company, but instead, it forced them to reevaluate their business model. The founders decided to shift their focus to agriculture. Now they sell intelligent machines that assess the needs of individual plants and as a result reduce the amount of pesticides and herbicides used in food production. For instance, the company sells a machine fondly referred to online as the weed-killing lettuce robot that can target unwanted plants or thin lettuce crops without resorting to chemicals

The firm has raised seed money (no pun intended) to help carry out its significant shift in scope. It’s important to note that the company stayed true to its original vision of robotic solutions, but simply changed its target market.

One of the most challenging aspects of reshaping a business is figuring out how to bring existing employees along for the ride, according to Carly Guthrie, an HR professional who has worked for several tech startups including CardSpring, which was acquired by Twitter in 2014. In a recent interview with tech publication First Round Review, she explains how pivots can end up pushing talent to quit. “Let’s say you’ve had a couple of pivots and you just don’t believe in the company or concept anymore,” she writes. “You (can) lose confidence in the marketability or leadership.”

That brings up another point businesses of all sizes should keep in mind when refashioning themselves: While pivoting too slowly can be deadly, turning the ship too soon can also be dangerous

History is littered with companies that pivoted too quickly away from their original offerings and were met with backlash by either investors or users – and in some cases, both. Yahoo, for example, has tried to save its business by diversifying away from its core offering. The Internet company famously went on a buying spree and acquired several well-known content startups, such as clothing e-platform Polyvore and email management system Astrid, for millions in 2015.

The company’s attempted turnaround failed to entice advertisers or boost company revenue, but did manage to alienate some of its core users. A pivot for its own sake isn’t always a good idea – while a strategic turn into more profitable lines of business or potentially lucrative uncharted waters can pay dividends, making changes out of desperation is a move that rarely pays off.