Target plans to lay off several thousand employees over the next two years as part of a restructuring effort that will save the company $2 billion in costs, the retail giant said in a meeting with investors and analysts Tuesday.

The move is a pillar of CEO Brian Cornell's longterm plan to put the discount retailer back on the right track after years of missteps and lackluster performance by homing in on a few key product groups, opening smaller urban stores and shoring up online sales.

The company said the majority of the jobs will be lost at its headquarters in Minneapolis.

According to Cornell, some of the resources that are freed up by the cuts will be directed toward bolstering the four categories of products that Cornell wants the store to be known for — the style, baby, kids and wellness sections. The retailer is also revamping its grocery offerings with more local brands and fresher food.

Target also plans to focus heavily on courting online shoppers. The company will invest a huge chunk of the $2.1 billion it plans to spend this year on capital projects — money that is often spent on new stores and renovation — on beefing up its mobile marketing and online sales. The retailer's digital platform had lagged behind competitors after Amazon stopped managing it in 2011 until it revamped its website last year, which allowed it to gain some ground.

The company grew its digital sales by 36% last year, and it's projecting a 40% jump this year. Meanwhile, same-store sales in physical stores are set to increase only 1% and overall sales between 2% and 3%. According to the company, customers who shop online and in stores generate three times as many sales as in-store-only shoppers.

Another piece of Target's plan is a shift toward smaller stores that serve densely populated cities. The company plans to open eight more of its TargetExpress and CityTarget stores throughout this year.

Cornell was brought on to lead the company last summer after former CEO Gregg Steinhafel left in the wake of a massive data breach that hamstrung holiday season sales in 2013 and left a major dent in the company's reputation. At the time, executives also worried that the retailer had lost touch with its cheap chic roots, according to the Wall Street Journal.

Now the retail giant is hoping to recapture its image as a purveyor of cut-rate trendy apparel and home decor. At its height, Target's novel blend of hip, designer wares and low prices gave it a leg up on blander counterparts like WalMart and Costco. Now that model has been replicated by rivals like Kohl's and Macy's.

Target operates nearly 1,800 stores across the U.S. Earlier this year it shut down all of its Canada stores less than two years after it first ventured into the country.