In a most forgettable of years for most investors, perennially patient International Business Machines (IBM -0.92%) shareholders have reason to cheer. The stock has been walloping the market. With just a couple of weeks to go until 2023, IBM is up 10% in 2022 (including dividends paid) versus a negative 18% total return for the S&P 500. If you’ve been following along, this stellar performance is no surprise. IBM has been clearly broadcasting its plans to get its business back on track for quite some time. There are valuable lessons to be learned from how the ancient computing giant pulled it off. When being “boring” is a good thing To understand how IBM is knocking socks off, you need to revisit some critical action taken by CEO Arvind Krishna and the top team back in 2021. Specifically, I’m talking about Krishna and the company’s decision to offload the legacy “managed infrastructure” business, which since late 2021 is its own separate independent company known as Kyndryl (KD -1.11%). You can read about that in this article from October 2021. But if you’re looking for the too-long-didn’t-read version, the rationale was simple. Designing, building, and managing large-scale IT hardware systems still has value, but it isn’t a growth industry. These days, IT hardware and systems management is a commodity. The profit margins are thin. Data by YCharts. But what is growing and still has above-average profit margins? cloud. And IBM’s various cloud services were being overshadowed by its legacy operation. But with Kyndryl now removed from the mix, IBM’s cloud computing (led by Red Hat, which it acquired back in 2019) can now shine a bit more clearly. To be clear, IBM’s financial performance hasn’t been mind-bogglingly good, but “boring” is good enough during bear markets like 2022. A corporate reorganization wasn’t so exciting from 2019 to 2021 when hypergrowth stocks were at the pinnacle of their popularity, but the merits of Krishna’s actions have been plenty popular this year. Revenue grew 6% year over year in the third quarter of 2022, or up 15% when excluding the effects of a record run-up in the US dollar against foreign currencies. Based on the numbers IBM had been putting up for most of the previous decade-plus, this is really great news for those who have stuck with good old “Big Blue.” Finding value in a really old haystack To be clear, IBM still has work to do. Free cash flow, which is the profit metric from which dividends are paid, has dipped this year. Much of that has to do with the aforementioned performance of the US dollar versus other currency values (it lowers the value of an international sale when converted back into dollars). But IBM has also acquired a string of small cloud computing consultants to cement its position as a go-to cloud provider for businesses. Those takeovers have also lowered profitability for the time being. Nevertheless, management is expecting a full-year 2022 free cash flow of about $10 billion, compared to just $6.5 billion in 2021 and $10.8 billion in 2020. That doesn’t seem like much of a statistic, but bear in mind that this year’s free. cash flow performance is without Kyndryl, which was a significant amount of IBM’s legacy revenue. If finding value was like searching for needles in a haystack during the 2010s, Krishna has found success by significantly reducing the size of the haystack. So far, it’s working. Will IBM do it again in 2023? Of course, if you aren’t an IBM shareholder, the company’s 2022 performance means little. Will the stock repeat in 2023? Perhaps. Much of this depends on what the market does next year. If economic conditions start to improve, the stock market could be due to a huge rally. IBM is still no fast-growing company, so chances are it could be left in the dust by some of its younger cloud-computing peers in this scenario. But if the economic storm clouds stick around, IBM’s slow-but-steady business could remain in vogue. As of this writing, IBM stock trades for 18 times its trailing 12-month free cash flow. It isn’t exactly cheap like it was this time a year ago, but I certainly wouldn’t call it a bad deal either — especially if free cash flow makes a run higher in 2023. But the more important lesson here, I believe , is the importance of diversifying. Even if high-flying trendy business disruptors are your game, there’s value in mixing in stocks like IBM. While far from exciting, stable dividend-paying stocks run by a savvy management team can help balance out your holdings when the going gets tough. IBM could be one of those stocks worth holding on to for the long term. Make your bets and compile your portfolio accordingly. Nicholas Rossolillo and his clients have no position in any of the stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.