Snapdeal seems to have learnt its lesson.

Once counted among India’s top three e-commerce firms, the Gurugram-headquartered company’s ship began to sink last year even as rivals Amazon and Flipkart continued to surge. Snapdeal even came close to merging with Flipkart.

In July 2017, the company upgraded itself to Snapdeal 2.0, shedding much of its workforce and selling off its payments and logistics businesses along the way. Then, for over a year, it went into incognito mode.

On October 9, co-founder and CEO Kunal Bahl resurfaced to share a LinkedIn post detailing what went into the ailing startup’s turnaround to become cash flow positive by June 2018.

“…we are building a company in the most hyper-competitive e-commerce market in the world, up against not one, not two, but three multi-hundred billion dollar global e-commerce behemoths,” Bahl said, possibly referring to Amazon, Walmart-Flipkart and Paytm-Alibaba. “Every day requires us to be sharp with our execution, and mindful with our decisions to start or stop initiatives. We can’t afford to do too much, and at the same time, we can’t afford to do too little.”

Below are some takeaways from Bahl on how struggling entrepreneurs can fix their broken startups, along with what experts in each area feel about his learnings:

Cut cost

“E-commerce is a thin margin business. These margins can very quickly be devoured by inefficient business processes. We looked at each and every bit of what we do—sharply reducing logistics costs, re-negotiating technology contracts, converting fixed costs to pay-as-you-use and optimising our establishment costs. Anything that lost money had to either go or had to be recast in a profitable mould. We were clear that while the arc of building a company is long, it needs to bend towards profitability.”

Experts believe keeping costs under check should be among the top priorities for entrepreneurs. “Specifically shedding non-core assets like Freecharge and Vulcan Express was important to generate cash but more importantly to avoid losing focus (for Snapdeal),” said Harish HV, an independent consultant who tracks India’s tech sector. “It is best to limit capex (capital expenditure) and convert as much as possible into opex (operational expenditure) which can be varied based on how business scales up or down.”

Pick the right leaders

“Snapdeal’s leadership team’s tenacity and agility is a big part of who we are as a company and it was important that new members of the leadership team shared the same grit, ethos and sense of purpose. The missing positions in the leadership team were filled by new members, who were carefully selected to match the talent and dedication of this team. They came with rich experiences at leading enterprises including Google, Motorola, Pine Labs, MakeMyTrip, Oyo Rooms, Zomato and many others.”

“If there’s a lot of disorientation in leadership, each individual will try to pull the horse their way. That wouldn’t work. That’s probably what happens at the start,” said N Shivakumar, business head of recruitment process outsourcing at Teamlease Services. “Now, they can streamline and work towards a common goal.”

Create a lean workforce

“From near death to generating cash, from despondency to resurgence—it took a lot of courage, focus and discipline to turn the ship around sharply. And we achieved all this with a nimble 800+ member team—in a flat, agile structure responding in real time to external and internal needs. Healthy, rejuvenated and in control of its own destiny, Snapdeal is now sailing ahead towards brighter horizons (and we also just moved into our brand new, open plan office, which means no cabins for anyone).”

“Sometimes, you have to prune to grow,” said Sanchit Vir Gogia, chief analyst and CEO at Greyhound Research. “And the more you prune, the more effort you put to automate things, to streamline things, to put in governing structures so that the company doesn’t derail again after this.”

Letting go of people “ensures that the old culture makes way for new, else as we know culture eats strategy for breakfast,” said Harish HV.

Fix culture

“Well stocked pantries and after-office parties create temporary highs, nothing more. Culture is built on a shared sense of purpose, clarity of goals, prompt feedback and genuine appreciation…

…We set up various forums for rewards and recognition for the team members…At “Chai Pe Charcha” with (co-founder) Rohit (Bansal) and I, top performers gathered around each month and chatted—we discussed everything—our personal lives, issues about work, short term worries and long term hopes. These sessions also brought the high achievers together—the work paths of a data scientist who made a change to an algorithm that reduced returns the previous month and a call center agent who routinely delighted customers by going beyond the call of duty would otherwise not have crossed. The enthusiasm of each member of the team is the building block of our business, and the waning despair being replaced by growing positivity was becoming quite visible.”

“There are two ways to run an organisation: carrot and stick. With (a) stick, you keep badgering people to (the) extent where they perform under fear but that’s not long term,” said Shivakumar. “Second is to record happiness. Every incident, big or small—client win, good proposal, launching new operations—you give a word of appreciation. That’s recognising people at value level and not at a peripheral level of saying happy birthday and cutting cakes.”

Hold your head high

“Don’t let skeptics discourage you. Recently, someone asked me, “So, what are you upto these days?” – suggesting that there must not be a lot of work left to do at Snapdeal (or even better that there may no longer be a Snapdeal!) and that I may have shifted focused onto other endeavours. I smiled and moved on to the next item on my task list. It’s not my intent to convert people, and I don’t let their ignorance or indifference deter me either.”

“We’ve seen a man like Elon Musk keep fighting despite SpaceX’s rocket launch failures and backlash from the US government. The man has stuck by his vision,” said Shivakumar. “For every startup founder, the company is as good as a baby. And you don’t quit on your baby.”

This article first appeared on Quartz.