Premium coffee roaster and coffee-shop operator DiedrichCoffee (NASDAQ:DDRX) is shuttering its java joints to focus on roasting and franchise operations instead. Starbucks (NASDAQ:SBUX) will pay $13.5 million for 47 Coffee People and Diedrich Coffee stores; the new owner is expected to retain most of the employees manning these stores. The remaining two company-owned stores will apparently close.

Steve Coffey, Diedrich Coffee's CEO, says that the changes will allow the company to "utilize our core strength as the premier roaster of specialty coffee and to fulfill our promise to sell great coffee to the widest possible market." The wholesale operations, where Diedrich sells its roasted coffees through grocery stores or direct to customers through its websites, have seen 46% revenue growth over the past year. Meanwhile, the retail segment grew sales by 12.1%, while franchise revenues were down 10.2%. Focusing on one's strengths makes sense, and it's clear from the company's financial reports that something had to be done. Take a look at the margin history, for instance:

Margins %

12/04

3/05

6/05

9/05

12/05

3/06

Gross

18.6

18.3

15.8

14.8

13.8

13.3

Op.

(6.1)

(6.6)

(9.9)

(11.1)

(12.9)

(13.4)

Net*

(3.0)

(2.7)

(6.3)

(7.2)

(9.6)

(11.2)

*Excluding earnings from discontinued operations and gains from sale of said operations.
All data courtesy of Capital IQ, a division of Standard & Poor's. Data reflects trailing-12-month performance for the quarters ended in the named months.

As of the latest SEC filings on March 8, 2006, Diedrich had $4.3 million of cash on hand, with nine straight quarters of net losses and a loss of $12.4 million in free cash flow over the trailing 12 months. Unloading the retail stores will lighten operations tremendously, and the $13.5 million from Starbucks will come in handy to shore up the company's balance sheet.

Starbucks is also a serious roaster, and will remain a competitor, although that game will now be played on Diedrich's home turf. Peet'sCoffee & Tea (NASDAQ:PEET) is playing much the same role Starbucks does, with both roasting and retail operations. Caribou Coffee (NASDAQ:CBOU), on the other hand, just lost a competitor, while gourmet roaster Green Mountain Coffee Roasters (NASDAQ:GMCR) and bulk coffee-processing operations like Procter & Gamble's (NYSE:PG) Folgers and Kraft Foods' (NYSE:KFT) Maxwell House are gaining a more focused and financially stronger adversary. Now let's see whether Mr. Coffey can perk up this sad story and make it a turnaround success.

Starbucks is a Motley Fool Stock Advisor recommendation. To see what Tom and David Gardner like about the leading caffeine merchant, take a 30-day free trial.

Fool contributor Anders Bylund holds no position in any of the companies discussed here, but is seriously addicted to great coffee. You can check out Anders' holdings if you like -- his stocks, not his Full City Roast Huehuetenango beans. Kraft is an Income Investor pick. Foolish disclosure is always fragrant and flavorful.