While Facebook is embroiled in controversy after controversy and Snap faces questions about its traction and viability, long-maligned Twitter is suddenly feeling the warm fuzzies from investors.

The company announced today that it will use this momentum to raise $1 billion in debt through a sale of bonds that could be later converted to stock or cash. Twitter said it would use the money to restructure some of its finances, but also for “general corporate purposes,” which could mean anything from investing in new products to acquiring other companies.

While Twitter has battled some of the same questions as Facebook regarding fake news, fake accounts, and harassment, it has not suffered quite the same damage to its reputation. At the same time, CEO Jack Dorsey has managed to turn the company’s finances around just enough to post Twitter’s first quarterly profit earlier this year.

As a result, Twitter’s stock price has more than doubled over the past year, rising from $16.90 one year ago to $39.80 at the close of trading yesterday. Twitter will also be added to the S&P 500 in July, an event that will continue to boost the stock, since numerous index funds will be required to buy shares for their portfolios.

Twitter must still overcome big challenges in terms of continuing to increase its user base, tamp down the unsavory parts of its service, and find more effective ways to monetize. But, for the moment, investors seem convinced that Dorsey has the company on the right track to fulfill its potential.