IBM's (NYSE:IBM) stock price dropped by 13% in 2014, while the S&P 500 index registered a 12% gain. The company's problems are no secret to its shareholders: IBM's financial results are suffering because it remains weighed down by hardware, which is not a growth area within technology.

While it's easy to continue piling on IBM at this point, investors need to think about the potential opportunity ahead. This is still a highly profitable company that generates a lot of cash, most of which is returned to shareholders. IBM is making the necessary investments to make its future better than its recent past. If the company can put a floor in earnings in the first quarter of 2015, it could set the stage for a very good year.

Step No. 1: Getting out of bad businesses
Years ago, IBM was universally regarded as a hardware king. Unfortunately, that became an anchor as the technology landscape has shifted, and IBM's inability to adapt left it a lumbering giant. At long last, IBM is doing what needs to be done, the company is shedding the low-growth hardware businesses that are keeping it down. Earlier this year the company sold its x86 server business to Lenovo for $2.1 billion. Then, upon issuing its third-quarter earnings, IBM revealed it would sell its semiconductor business to chipmaker GlobalFoundries.

These divestitures will help IBM's margins going forward -- this year the company has rid itself of business operations that generated $7 billion in annual revenue but produced $500 million in pre-tax losses. The business sold to Lenovo generated $4 billion in revenue in 2013 but no profit. More broadly, IBM's margins have suffered due to the continued problems in hardware. IBM's gross profit margin in its systems and technology unit stood at 33.9% last quarter, down six full percentage points year-over-year. By comparison, IBM's other businesses outside hardware carry satisfactory profitability, which explains management's strategic shift. IBM's gross profit margin in software was 87.6% last quarter, virtually unchanged from the year-ago quarter.

These are important steps, and will free up capital to be reinvested in areas that will accelerate IBM's transformation. The company needs to focus on higher-growth software and services, particularly in areas such as the cloud and Big Data. IBM is making progress in these areas. Over the first nine months of 2014, IBM's cloud offerings grew revenue by more than 50% year-over-year . Last quarter, cloud-delivered-as-a-service revenue increased 80% to reach a $3.1 billion annual run rate.

Step No. 2: Value investors step in
At some point, IBM's turnaround should materialize, at which point bargain-hunting investors will likely step in and buy the stock. IBM might not seem like a value stock when its revenue and earnings are still falling, but assuming its earnings can find a floor, the stock is cheap. IBM trades for 12 times trailing earnings and just nine times forward earnings-per-share estimates. IBM's forward P/E multiple is at its lowest point in five years.

For all IBM's problems, the company still generates a lot of cash, and it returns the majority of that cash to shareholders. Even though revenue fell 3% through the first three quarters of the year, free cash flow totaled $5.7 billion,  an indication of IBM's underlying business strength. In the first nine months of 2014, IBM repurchased $13.5 billion worth of its own stock. These share buybacks are the pillar of Big Blue's capital allocation program; now that the stock price is down, the money spent on repurchases goes even further. In addition, IBM spent $3.1 billion on dividend payments to shareholders during this period. Thanks to IBM's low stock price, its 2.9% dividend yield represents a five-year high.

The bottom line is that IBM is cutting its losses in businesses that are no longer worth keeping, and reinvesting in new areas such as data and the cloud that will fuel its turnaround. If IBM can put together a solid quarter soon, it might lure investors back to the stock.