Slowdown in the global economy has hit the construction equipment industry hard, leaving investors in the lurch. Industry leader Caterpillar (NYSE:CAT) is among the worst-performing Dow stocks this year, down 11% year to date.

Amid the gloom, one equipment maker that was surprisingly keeping its head above water was Terex (NYSE:TEX). While Caterpillar bled, Terex's stock hit a 52-week high in May. As of June 3, Terex's stock was returning a handsome 20% year to date. Then the inevitable happened.

In three weeks flat, Terex gave up all those gains, and more. The stock plunged, and is down 10% year to date, as of this writing. Has Terex then become too risky for investors, or is the fear overdone?

Why did it tank?
While global weakness was a factor, the bloodbath in Terex's stock was triggered when the company lowered its full-year earnings guidance to a range of $1.90-$2.10 per share, down 20% from its former projection. Terex cited weakness in two of its divisions – construction, and material and port handling solutions, as the reason. The two businesses, which accounted for nearly 42% of Terex's total sales last year, were the major drag on the company's performance last quarter. Blame the deepening crisis in Europe.

The Euroconstruct research group projects the European construction market to shrink by 3% this year. Worse yet, it expects the market to grow by just 0.5% and 1.7% in 2014 and 2015, respectively. With Europe contributing more than 30% to Terex's top line, investors have a reason to worry. But, only for the short term, because Terex's main business is going strong, and the company is strengthening key areas which should help build a solid foundation for the future.

Power backbone
A quarter of Terex's revenue comes from its aerial works platforms division, or AWP. Even as Terex's other businesses struggled, AWP reported a solid 21% jump in revenue year over year in the last quarter. As a result, the unit's share in the top line climbed to 30% during the quarter. Moreover, AWP was the only division to report a double-digit growth in backlog (value of firm orders that will most likely convert into revenue within one year) last quarter.

AWP equipment, which includes booms, lifts, telehandlers, and trailers, is primarily used in residential and commercial construction, setting the stage for Terex to take advantage of the ongoing recovery in the U.S. housing market. What's fueling sales further is robust replacement demand, primarily from rental companies.

In fact, most of the equipment makers today are banking on the customers' needs to replace aging fleet. In its last earnings call, Caterpillar's management even went to say that most of what the company sells is "through replacements." Another equipment maker, Oshkosh (NYSE:OSK), recently upgraded its full-year, earnings-per-share guidance despite struggling to keep its primary defense equipment business afloat in the wake of U.S. budget cuts. The upgrade, which even at the lower end translates into a solid 28% jump from 2012 earnings of $2.27 per share, was almost entirely on the back of strong replacement demand for AWP equipment. Oshkosh derived 41% of its revenue from the access equipment business in the last quarter.

In short, the AWP business could help Terex offset some of the weakness in other divisions. Moreover, Terex could also get support from its cranes unit which contributed 27% to its revenue in the last quarter. Peer Manitowoc (NYSE:MTW), which gets 60% sales from cranes, expects revenue from the business to grow by "high single-digit percentage" this year.

Management efficiency
The crane segment was also the only business for Terex beside AWP to report a higher gross margin year over year in the last quarter, thanks to better pricing and cost cutting. To tackle economic challenges, Terex is aggressively reducing costs through moves like selling off poor-return businesses such as road-building products in Brazil and construction equipment business units in Germany. In fact, Terex has been realigning operations across segments for a long time, the effects of which are reflected in its expanding gross margin. The chart below shows the percent change in Terex's quarterly gross margin vis-à-vis peers over the past three years.

TEX Gross Profit Margin Quarterly Chart

TEX Gross Profit Margin Quarterly data by YCharts

Terex is the only company to have expanded its gross margin since 2010. While Manitowoc's margin has remained relatively flat, both Caterpillar and Deere have seen their respective gross margins shrink by 7% each. Caterpillar can blame the sluggishness in the mining industry, which is responsible for 41% of its revenue, while Deere (NYSE:DE) has had to put up with headwinds like the severe drought that ravaged the U.S. last year. Deere gets 80% of revenue from farm equipment and the rest comes from the construction market. Though Terex's gross margin at 19% isn't the best in the industry, the growth, as evidenced by the chart above, is hard to ignore.

Internally strong
Apart from margin expansion, Terex is also strengthening its balance sheet. The company's long-term debt soared to $2.2 billion when it acquired Demag cranes in late 2011. Terex has pared down the figure by nearly 10% since then. At the same time, Terex's annual net income has more than doubled since the acquisition. More importantly, Terex generated $344 million in free cash flow last year, thrice the amount of net profit it earned. Few companies do that.

Strong cash flow, coupled with the recent drop in price, means Terex's stock is currently trading at a strikingly low price to cash flow ratio of 6.9, which is also the lowest among peers. While Caterpillar is a close second with a P/CF ratio of 8.6, Deere looks expensive at a P/CF of 21. Manitowoc and Oshkosh are both trading at around 12 times cash flow.

I don't think prudent investors should read much into Terex's earnings downgrade. The company's long-term story remains intact, and I like its management's focused approach on making the company leaner and better. At current prices, Terex looks like a good bargain. Click here to add the stock to your watchlist.

Fool contributor Neha Chamaria has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. Try any of our Foolish newsletter services free for 30 days. We Fools may not all hold the same opinions, but we all believe that considering a diverse range of insights makes us better investors. The Motley Fool has a disclosure policy.