Starbucks plans to roll out mobile ordering across the chain's U.S. company-owned stores by the end of the year. Image source: Starbucks

Starbucks (NASDAQ:SBUX) has been a leader in getting people to use their smartphones to pay, and now the company is expanding a program that lets customers of the coffee chain order from their phones.

What: The coffee giant began testing mobile ordering via its app through a pilot program in Portland, Ore., in December 2014. That effort was expanded across parts of the Pacific Northwest in March 2015. Today, the company announced plans to offer mobile ordering in stores in 21 more states in the southern and central United States starting immediately. That will bring the offer to more than 4,000 Starbucks locations.

The system currently works only on Apple (NASDAQ:AAPL) iPhones, but the company plans to expand the program to Android devices and have it in all U.S. company-operated stores by the end of 2015.

So what: One of the biggest problems facing Starbucks is its ability to serve customers quickly during peak hours. The chain has become pretty good at using clever tactics, like having a staff member take orders from the line, but wait times can be long during the busiest times of the day. Being able to place an order on your phone and have it ready when you get to the store not only eliminates that, it also takes people out of line. That's great for the store, the people ordering on their phones,  and the people waiting in line.

"We can have fairly long lines in the morning and it's such an awesome option for customers looking to run in and out if they're running late," said Starbucks store manager Jesse Wenkoff-White in the company press release. "I've had so many people tell me how convenient and easy it is. Our customers that use it absolutely love it."

Mobile ordering can lessen a pressure point for the chain. That will make its customers happy and should stop some people from seeing how long the line is and walking away.

Now what: Testing a program and rolling it out nationally are different animals. The challenge now for Starbucks is executing. The company has been a leader in integrating mobile payments, but managing mobile orders and getting them out to customers will present a whole new set of challenges.

"When we first starting practicing with Mobile Order & Pay before the rollout, we were all pretty cautious," said Kaylene Schaefer, another store manager. "But once we got used to it, it was great. By the time we got our first mobile order ticket on launch day, our team was so excited."

That's encouraging, but a quote in a press release does not change how massive a task it is to train personnel -- many of them part-time -- in busy stores all around the country. Starbucks has experience with this and likely will ultimately pull it off, but it could be a rocky beginning.

Mobile ordering solves a major problem for the chain and it could ultimately lead to increased sales and more satisfied customers. Also, it won't hurt that people won't have to verbalize their embarrassing order for a half-caf, six pump, raspberry/peppermint latte.

Is it available in your state? Maybe. Mobile Order & Pay is available in Alabama, Alaska, Arizona, Colorado, Florida, Georgia, Idaho, Kansas, Louisiana, Mississippi, Montana, Nebraska, Nevada, New Mexico, North Carolina, North Dakota, Oklahoma, Oregon, South Carolina, South Dakota, Texas, Utah, Virginia, Washington, and Wyoming.