Retail is not dead. In fact, many retail stocks have been given new life thanks to the Republican tax cut.

With extra cash to spend on corporate strategies, many companies have revamped their e-commerce business and upgraded physical stores—improvements that have resulted in solid gains both in market value and earnings. Since early November, the SPDR S&P Retail is up almost 12%, and many stocks within the index have seen rallies of over 50% in 2018.

Target Corp., which pledged to invest $7 billion into its brick-and-mortar operations last year in an effort to better adapt to evolving customer preferences, recently saw its best quarterly profits in more than a decade. The company’s stock closed at $87.31 per share Friday and is up 29.10% so far this year, driven by a series of record highs the retailer hasn’t seen since 2015.

“The tax cut enabled many retailers to pull forward the strategy-spending early this year that they planned to implement over the next few years,” said Daniel L. Kurnos, a senior analyst at the financial firm Benchmark Co. LLC.

Like Target Corp., Macy’s Inc.’s performance surprised investors who ostracized the U.S. department store after its stock fell 75% in November 2017 to $17.41 per share, its worst performance in the last five years. The retailer bounced back after consecutive quarters of growth and, despite a volatile year, is still up more than 35% in 2018.

The department store chain also announced last year that it plans to spend $1.05 billion on improving its physical store and e-commerce business.

Whether Macy’s stock performance is sustainable will be tested by the holiday season, many analysts said. Though the company is performing considerably better than it did last year, its stock price still weaves in and out. The retailer’s p/e ratio, the price of the share divided by earnings, is less than 7.

“Overall, retail is doing pretty well this year, and that is likely to continue for the rest of the year,” said Jennifer Bartashus, senior equity research analyst for retail staples and restaurants at Bloomberg Intelligence. “There’s been a nice uptick in traffic to physical stores that is complemented by growing online sales.”

Though many traditional retailers that have been left for dead by investors have rebounded this year, they still lag far behind the e-commerce behemoth Amazon, whose stock soared almost 70% in 2018 so far.

“Amazon was honestly a no-brainer, and I should have gotten it before,” said Andrey Kovalev, a product operations manager at the marketing data firm LiveRamp, who bought Amazon stock in March.

“Warren Buffet’s number one rule of investing is to buy stock in companies and products you use,” the 24-year-old said. “I think it’s very safe to say we all use Amazon. I really wish I had gotten a lot more and a lot earlier because I think it’s one of those companies that will last for centuries.”

That Amazon has shaken the retail industry and continues to pound department stores is unquestionable. But some investors think smaller, more traditional merchants have hope if they focus on growth and improvement rather than profit.

And investors continue to flock to the stocks of online retailers they expect to continue to gain market share.

Furniture e-commerce company Wayfair Inc., a more direct competitor to Amazon than other retailers, has applied the bigger-picture strategy—and it shows in its earnings and stock growth. Company shares grew around 65%, not far behind Amazon’s 70% gain and far above the S&P 500, which rose less than 10%.

The online home store’s performance is the result of successful focus on their corporate business model, according to analysts.

“I think Wayfair understands the nature of the beast,” Kurnos said. Wayfair stock is doing particularly well because people have been betting against it for so long and the shorts keep getting squeezed—not necessarily because they are keeping up with Amazon, they’re just outperforming expectations, Kurnos added.

The power of Wayfair’s business is also seen in its strong earnings. The company’s sales have improved by almost 50% this year. The number of active customers in Wayfair’s direct retail business reached 12.8 million as of June 30, an increase of 34% year-over-year, according to a company statement. Orders delivered in the second quarter of 2018 were 6.5 million, an increase of 50.8% year-over-year, the same statement showed.

“The key to Wayfair is their delivery network,” said Ronald Bookbinder, an analyst at the boutique investment firm, IFS Securities. Their free shipping and reliability in delivering often bulky furniture quickly separates the company from other specialized online retailers. The convenience of purchasing online, the value pricing and top-notch delivery make Wayfair a compelling store, Bookbinder said, adding that other companies should focus on the same business facets if they want to survive in the Amazon age.

“Companies have to cut the underperforming stores and reinvest into the productive stores, putting down a compelling product in a compelling environment,” Bookbinder said. “Then you back it up with the needs of shopping online.

Despite the activity in the retail sector, analyst predictions about whether gains are permanent vary. Some inferred market growth will subside once post-tax cut spending cools, and others suggested we’ll see the impact of tariffs offset gains next year. For now, investor behavior shows a sense of optimism.

“Global e-commerce still has a long way to go and at some point, large numbers will catch up to Amazon,” Kurnos said. “But I don’t see growth slowing down in the next six months.”