This article originally appeared as part of ongoing coverage in our premium Motley Fool Rule Hidden Gems service...we hope you enjoy this complimentary peek!

The last year hasn't been kind to AZZ (AZZ -0.60%), with the company missing adjusted earnings estimates in 2 of it past 4 quarters and the stock trading 21% off its high. 

AZZ Chart
AZZ data by YCharts.

Following the release today of the company's second-quarter earnings, shares plunged 10% before recovering nearly completely to yesterday's closing price. Let's examine what has been going wrong with the company and see if a turnaround is around the corner. 

AZZ Price Chart
AZZ Price data by YCharts.

Q2 results
Analysts had expected AZZ to report $0.64 per share in earnings from $208.18 million in sales. Instead, the company reported $0.53 per share in earnings from $193.4 million in revenue, a miss of 17.2% and 7.1%, respectively. This represents the largest earnings miss for the company in the last four quarters. 

Digging into the numbers
Compared to last year's second quarter, sales were up 1.9% but earnings plunged 17.2%. What explains these disappointing results? As management explained, the company took a $4 million pre-tax reorganization charge this quarter, equivalent to $0.11 per share, due to its reduction in management headcount and a write-off of certain underperforming assets. Adjusted for this expense, earnings were $0.63 and close to expectations of $0.64 per share. 

In addition to the one-time charge, AZZ during the quarter sustained $8.6 million in cost overruns that compressed margins and project shipping delays in its energy segment, specifically in its Nuclear Logistics (NLI) and WSI subsidiaries.

In a press release, President and CEO Tom Ferguson said of the results: 

Revenue levels reflected the seasonal nature of our business, but the margins were disappointing.  Although I am not satisfied with the results for this quarter, I do recognize that margins were affected by a number of operating inefficiencies within our Energy Segment. We have identified and corrected those items under our control, and do not expect them to recur. We have also taken realignment charges to clean up some non-performing assets and recognize the cost of building a more effective leadership team. With the realignment largely completed, we have already seen positive change as we now have the right personnel and leadership in place.  

Some good news
Despite the disappointing quarterly results, the news wasn't all bad for AZZ. While the energy segment saw a 3.4% decline in revenue and operating income declined by 110.4% due to the problems at NLI and WSI, the galvanizing services segment reported improved results.

Sales for the segment (which coats steel in protective zinc to prevent rusting) were up up 8.4%, mainly due to the return of the company's Joliet, Ill., galvanizing plant (one of 36 it operates in 15 states and three Canadian provinces) which suffered a major fire in 2012.

Sales were also boosted by the company's June 30 acquisition of Zalk Steel & Supply, which operates a galvanizing facility in Minnesota.

However, operating income from this segment wasn't nearly as impressive as the revenue growth, declining 12.3% from the same quarter last year. The reason for this? Margin compression from 30.6% operating margin to 24.8%, due to a combination of factors. These include the $2.7 million insurance payment the company received last year for the business interruption it suffered due to the Joliet facility fire, which wasn't repeated this year. This segment also incurred added costs in the form of increased depreciation and amortization expenses from the Zalk Steel acquisition, costs associated with reopening the Joliet facility, and a portion of the reorganization charge discussed earlier.  

Management reiterates guidance
Investors looking for some silver lining to a bad quarter can take heart in the company's strong backlog of projects, which increased 11.9% to $329.1 million. Management also reiterated its guidance for full fiscal year sales and earnings of $850 million-$900 million and $2.40 per share-$2.80 per share, respectively. 

Management also showed confidence in its claims that the reorganization is largely complete by increasing the quarterly dividend by 7.1%, from $0.14 per share to $0.15 per share. 

What to watch going forward
Despite AZZ's difficulties this year, analysts are still bullish on the company's growth prospects. Next year's earnings are expected to grow at 28.6%, with a five-year annual earnings growth projection of 13.95%. 

In order to achieve this long-term growth, investors and potential investors should keep an eye on whether the reorganization is truly over. Specifically, this means whether the company has to take any more charges in the future. In addition, investors should watch to make sure that cost overruns at NLI and WSI don't continue to hurt margins and that customers don't continue to delay orders

The growing backlog is a certainly a positive for the company (last quarter it grew by 14.2%) . And as long as the company continues to grow at a steady clip, management can complete its reorganization on schedule, and costs are kept under control, AZZ's likelihood of achieving the strong earnings and dividend growth that analysts are expecting will be greatly increased.