Heading into the second Democratic presidential debate, Hillary Clinton seems to be winning her party back.

Polls taken in the last two weeks show Clinton widening her lead over Bernie Sanders, as she’s used sterling performances in the first Democratic debate and a marathon session before Congress to blunt the momentum Sanders had seized over the summer. When the two meet Saturday night in Iowa, the pressure this time will be on Sanders: Can he sharpen his contrast with Clinton without veering into the kind of negative attacks that he repeatedly promised to avoid?

Clinton has benefitted from a number of developments in the last month—and not all of them her own doing. Vice President Joe Biden’s decision not to seek the nomination deprived establishment-minded Democrats of another alternative to the former secretary of state. And the dubious choice of House Republicans on the Benghazi committee to have her testify for 11 hours—while harping on emails from Sidney Blumenthal—played to her advantage by allowing her campaign to portray her appearance as one of resilience and grace under fire rather than the long overdue reckoning for a dithering diplomat.

Still, Clinton deserves some of the credit. Her campaign was understandably mocked when it informed The New York Times that Clinton would suddenly become more spontaneous, warm, and funny. But the plan seems to have been executed well. Her appearances on late-night talk shows have been filled with smiles and not-too-cringe-worthy jokes, and despite getting lower ratings, Clinton’s cameo on Saturday Night Live won stronger reviews than did Donald Trump's recent hosting gig. When Clinton has stumbled, such as when she laughed in response to a man saying he wanted to “strangle” Carly Fiorina, it has been overshadowed by news from the increasingly bizarre race on the Republican side. On the whole, a more joyful Clinton has replaced the halting, defensive candidate of the spring and early summer.