What happened 

Shares of Redfin (RDFN 5.08%) soared 30% this past week, according to data from S&P Global Market Intelligence, after the real estate services provider announced plans to close its home-flipping operations. 

So what 

Redfin's third-quarter results released on Wednesday were rough. Sharply high mortgage rates combined with stubbornly high home prices led to a steep plunge in home listings. 

Redfin's gross profit, in turn, plunged 54% year over year to $58.1 million. Worse still, its net loss ballooned to more than $90 million from $18.9 million in the prior-year quarter.

So why did Redfin's shares rally following its Q3 report? Investors were relieved to hear of the company's plans to close RedfinNow. The iBuying service essentially made Redfin a home flipper, exposing it to potentially massive losses during what many real estate professionals warn could be an imminent -- and severe -- downturn in the housing market. 

"Laying off 862 colleagues and friends is heartbreaking," CEO Glenn Kelman said in a press release. "But I feel relief about closing RedfinNow with relatively low losses."

Now what

The closure of RedfinNow will allow Redfin to focus its dwindling resources on its core real estate brokerage operations. That is where the company excels. Its popular website, low fees, and convenient tech-based approach have allowed Redfin to steadily gain market share in the enormous U.S. housing industry. 

In turn, the move makes Redfin more likely to survive a potential market crash -- and potentially emerge as a stronger and more profitable business.