Barnes & Noble (BKS) on Wednesday disclosed plans to split its retail and Nook units into two separate public companies, as the bookseller looks to breathe new life into its e-reader business.

Barnes & Noble said it will begin to take steps to complete the separation by the end of the first quarter of calendar year 2015.

The company also reported a smaller quarterly loss and beat expectations for revenue. Shares rallied 5.6% to $21.71 shortly after the opening bell.

Barnes & Noble has struggled to revitalize sales of digital books, along with Nook tablets and e-readers, in the face of competition from the likes of Amazon.com (AMZN) and Apple (AAPL). Earlier this month, Barnes & Noble unveiled a partnership with Samsung to have the electronics giant make Nook-branded Galaxy tablets, with the first device due out in August.

The Nook segment booked a 22% drop in revenue to $87 million in the retailer’s fourth quarter. Digital content sales were down 19% at $62 million.

The retail unit saw revenue climb 0.8% to $955.6 million. Same-store sales excluding Nook items fell 1.9%. Barnes & Noble said store traffic suffered from unusually severe weather in February.

“We believe we are now in a better position to begin in earnest those steps necessary to accomplish a separation of Nook Media and Barnes & Noble Retail,” said chief executive Michael Huseby, who took charge of the company early this year. “We have determined that these businesses will have the best chance of optimizing shareholder value if they are capitalized and operated separately.”

Barnes & Noble first suggested it could spin off its Nook business back in 2012 but eventually scrapped the idea. Instead, Barnes & Noble said it would end in-house tablet production and seek out a hardware partner.

Another option emerged when founder and chairman Leonard Riggio considered buying Barnes & Noble’s chain of book stores. That plan was abandoned a year ago.

For the period ended May 3, Barnes & Noble reported a loss that narrowed to $36.7 million from $114.8 million in the same period a year earlier. On a per-share basis, the company’s loss was 72 cents versus $2.04.

Revenue grew 3.5% to $1.32 billion. The quarter included an extra week compared to last year. Gross margin jumped to 32.1% from 18.1%, thanks in part to a 14% decline in input costs.

Analysts estimated a loss of 59 cents a share and revenue of $1.19 billion.

Barnes & Noble recently announced it will move its Nook Media division from a Palo Alto, Calif., campus to smaller facilities in Santa Clara and Mountain View, Calif. The move is projected to save Barnes & Noble about $10 million in annual occupancy expenses.

Follow Matthew Rocco on Twitter @MatthewRocco