The Indian information technology industry seems to be getting its mojo back.

After years of turmoil, the past few quarters have seen the country’s three largest IT companies, Tata Consultancy Services, Infosys, and Wipro, steadily win large contracts.

For instance, between December 2017 and January 2018, India’s largest IT services firm by revenue, Tata Consultancy Services, won at least three large multi-year deals amounting to about $5.5 billion (Rs 40 lakh crore). The second-largest company in the sector, Infosys, reported winning large deals of up to $2 billion during the July-September quarter. And Wipro announced a $1.5 billion deal in July from Illinois-based Alight Solutions, the largest ever contract reported by the company under its new CEO Abidali Neemuchwala who came onboard in February 2016.

Even mid-sized players have seen a strong deal momentum. In May, Bengaluru-headquartered Mindtree said it expects to gather deals worth more than $1 billion in the financial year ending March 2019.

The uptick in deals has come mainly from clients in the financial services and retail industries, and most projects include leveraging capabilities around newer technologies such as cloud, cognitive automation, data analytics, machine learning, and artificial intelligence.

“Till a year ago, IT companies were still consolidating investments in digital so the deal-sizes were smaller. Now that those investments have started earning revenues, the deal size has increased across the sector,” said Sanchit Vir Gogia, chief analyst, founder and CEO of Greyhound Research. “Digital investments will only grow now, although at a cautious pace, but it means larger orders for IT companies.”

The digital push

The recent good news is a payoff for years of investments made by Indian IT companies towards building new capabilities.

Among other things, IT companies have invested in mass re-skilling and up-skilling of their workforce. For instance, Tata Consultancy Services has trained over 210,000 trainees through internal programmes and Wipro has launched an initiative called Newton’s Cradle which identifies skill gaps in middle management and helps them upgrade. Between April 2016 and March 2017, Wipro trained 39,600 employees in digital skills.

“Only re-skilling is not the purpose. Identifying the skill gaps in a team and an employee is also important. Our system analyses personality, learning ability, post-learning assessment, and so on, to offer a holistic learning approach,” said Arjun Pratap, founder, and CEO of EDGE Networks, which works with several IT players to integrate their online learning modules.

Indian IT companies have also taken some harsh steps on the way.

Last year, the $160 billion industry laid off over 56,000 employees as automation and artificial intelligence left several job functions rudimentary. The pace of hiring has also been much slower than before. The IT industry added just 11,600 employees during 2017-18, as compared to 93,500 a year ago, according to credit rating agency ICRA.

Payback time

On October 11, while announcing its results for the July-September quarter, Tata Consultancy Services said it was seeing a revival in the banking, financial services, and insurance space majorly for contracts related to digital transformation.

“Banks in the US are deploying fresh investments into digital services such as speech and voice recognition, machine learning, and chatbots. So an uptick in demand is seen there,” Kris Lakshmikanth, CEO and founder of the recruitment firm Head Hunters India, said.

TCS plans to continue keeping the digital push at the center of its growth strategy. “We are focusing on the pillars of digital transformation as the new way of working and leading the automation phase while also strengthening the brand position,” CEO Rajesh Gopinathan said in June.

Infosys, which has acquired new tech companies like Seattle-based Wongdoody and London-based Brilliant Basics, also saw its digital revenue grow by 12.7% quarter-on-quarter in July-September. Digital services account for 31% of Infosys’s overall sales now.

“We are evolving our platforms. We are looking at how our flagship AI platform NIA, along with the automation platform AssistEdge, can come together to create a complete range of automation and machine learning capabilities for our customers,” Infosys co-founder and chairman Nandan Nilekani said in a post-earnings call on Oct. 16. “We are integrating and evolving our design capabilities so that we can accelerate the digital business.”

But there are still hurdles that remain to be crossed.

Not all is well yet

These new orders, coupled with a weak rupee, have given the Indian IT industry much reason to celebrate. Analysts are now bullish on the sector. “The second-quarter (July-September) growth, coupled with the benefits from a favourable currency, is likely to drive a continued recovery for the technology sector. Margins would be uplifted by the depreciation in the rupee versus the US dollar, while also getting support from the improving performance,” brokerage firm Motilal Oswal wrote in a report.

However, there are still some serious challenges facing the industry.

The regulatory environment in the US and the UK, the largest markets for Indian IT, remain a constant cause of worry. The uncertainty around Brexit has led clients in the UK to be cautious in spending and they are extending existing contracts with short-term deals, Satish Meena, senior forecast analyst at Forrester Research pointed out. “Big deals are yet to be seen from that region,” Meena said.

In addition, protectionism in the US and UK hangs like a sword over the Indian IT sector.

The Trump administration, for one, is set to revise the definition of employment and specialty occupations under the H-1B visas and also review the work permit allowance to dependents of H-1B visa under H-4. The move is expected to impact Indian IT companies, which leverage the H-1B non-immigrant visa, to send workers in specialty occupations to work with clients in the US.

The UK too revised its immigration laws in 2016, setting a higher salary threshold for anyone applying to work in the country, as it faces local economic pressure and rising unemployment issues.

This article first appeared on Quartz.