Wednesday was a tough day for the stock market, as the Dow Jones Industrials gave back a substantial portion of the average's gains from the previous session. Fallout from the resignation of Gary Cohn, the head of President Trump's National Economic Council, was the cause most often cited for the decline, with some political pundits concluding that his departure effectively means that the nationalist contingent within the White House has won out over the globalist group. Yet even amid general market nervousness, some companies enjoyed good news that sent their stocks higher. Autodesk (NASDAQ:ADSK), H&R Block (NYSE:HRB), and Medifast (NYSE:MED) were among the best performers on the day. Here's why they did so well.

Autodesk designs a nice gain

Shares of Autodesk picked up 15% after the computer-aided design software company posted its fourth-quarter financial results. The company has been working hard to make a transition away from one-time license-related revenue, instead counting on recurring revenue from a subscription service to generate more dependable and longer-lasting streams of income for Autodesk. Even with guidance for the first quarter that was weaker than most were expecting to see, Autodesk has long-term investors feeling good about its overall strategic vision in the years to come.

Entrance to building with Autodesk corporate logo above a wooden awning.

Image source: Autodesk.

H&R Block is well-prepared for profits

H&R Block stock rose 11.5% in the wake of the release of the company's fiscal third-quarter report. The tax preparation specialist saw its net loss expand as a result of tax reform legislation, but revenue was higher, and adjusted losses were narrower from year-ago levels. More importantly, the current tax season is going well, with return volumes rising both in the assisted return and do-it-yourself segments. CEO Jeff Jones was optimistic about the second half of tax season going well, and if the company can continue to execute as well as it has to start the new tax season, H&R Block could put itself in a great position to capture large numbers of taxpayers who'll need help when they file their taxes next year.

Medifast stays healthy

Finally, shares of Medifast soared 31%. The healthy-living product and program specialist said that its revenue was higher by 25% in the fourth quarter of 2017, helping to send net income upward by 78% compared to the prior-year period. Record growth from Medifast's Optavia coaching business was a major contributor to positive performance, with the size of its coaching network soaring by 2,500 to a total of 15,000 coaches. Other areas of the business, including franchised weight control centers and the Medifast Direct program, saw top-line struggles. Yet investors were pleased to see that activist shareholder Engaged Capital's founder and chief investment officer, Glenn Welling, had announced his resignation, signaling that Medifast has done what it needs to do to protect shareholder value from big competitive pressures in the weight loss industry.

Dan Caplinger has 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.