Companies of all sizes could learn a great deal from David Robertson's account of Lego. In his new book "Brick by Brick" (Crown Business), the University of Pennsylvania Wharton School professor tells the story of this family-owned business that began making wooden toys in the 1930s, experimented with plastic bricks in the 1940s and in 1958 patented its clutch power -- that satisfying click of bricks coming together. The company went on to become one of the most popular toys of all time. "There are now some eighty Lego bricks for every man, woman, and child on the planet," Robertson writes.

Lego enjoyed steep and steady growth for decades, with sales doubling every five years from the late 1970s through the early 1990s. Then, as happens with many mature companies, things started to slow. In the late 1990s, with kids' attention increasingly turning to the television and computer -- and its patents long expired -- Lego began taking drastic measures to stay relevant.

The company gave itself the license to innovate -- and that's when things really went south. Adhering to widely-adopted "truths" of innovation (i.e. hire diverse and creative people, be customer driven), Lego opened theme parks, hired Italian designers to dream up new lines and delved into electronics, video games and television.

Between 1994 and 1998 the company tripled the number of new toys produced -- averaging five major new product themes per year during that time.

Rather than spark growth, the initiatives nearly killed Lego. In 2003 the company saw its biggest loss in history and was on the verge of bankruptcy, with the majority of its products unprofitable.

Yet, Lego managed to save itself and go on to achieve incredible results. Between 2007 and 2011, when many companies were languishing, its pretax profits quadrupled. In 2012 it saw a 27% increase in sales and 36% increase in profit.

To achieve these results, the company downsized its workforce and corporate headquarters and trimmed roughly a third of its product line -- but the real results came when Lego changed its philosophy on innovation. "We often talk about innovation with a capital 'I' but companies can achieve great things with little innovations," says Robertson.

Lego's new thinking can be summed up by the following:

Innovation doesn't just happen at the product level. Too often companies focus all of their innovation efforts on their products. As was the case with Lego, this can result in looking too far afield. When Lego reversed all the damage it did in the late 1990s and early 2000s, it was by looking for areas of improvement across the entire company. "Most people talk about innovation on the product side," says Robertson. "If you accept that innovation isn't just in product development -- it can be in sales, finance, marketing -- now you have lots of different opportunities."

Innovation needn't be on a massive scale. In Lego's failed attempt to spark new growth it went after what Robertson calls innovation with a capital "I," such as opening theme parks, a costly business it didn't know anything about, or straying too far from what made it popular in the first place. "Lego listened to the research that most kids don't like construction toys and tried to make a big piece with no parts," says Robertson. "They had to pay a lot of money for new molds, ended up confusing people about the brand, and in the end it wasn't profitable."

Yet, innovation needn't be of massive proportions (i.e. Apple delving into the cellphone business.) Most companies, says Robertson, can expect one major breakthrough every five years; Lego was batting for five a year prior to its near collapse. "The key isn't just innovation but profitable, sustained innovation," he says. "I like the fact that in the end the Lego is the story about little innovations."

Innovation thrives within boundaries. Perhaps Lego's greatest fault was giving its designers license to create new products with very few parameters. As a result, between 1997 and 2004, the number of elements in the company's inventory more than doubled from 6,000 to 14,000 -- and consequently so did costs since, among other reasons, new elements require costly molds.

Beginning in 2004, however, Lego began giving its designers cost parameters; they could design anything they wanted as long as it fell within those limitations. Forced to work within those boundaries designers actually got more creative, not less, says Robertson. Managing innovation is about "giving teams the space to be creative but on the other [hand] there is direction, focus, targets and deadlines," he says.

In that respect, one could argue that Lego sets are an ideal analogy for the beauty of confined creativity. As anyone who has ever played with the ubiquitous bricks can attest, the best ideas sometimes come from thinking inside the box.