Few tech companies have had a rougher go of it in this past year than Twitter. The company remains in a constant struggle for its soul against malicious trolls, harassers, and foreign government propaganda machines. All the while, its leadership has rolled out new features design changes in hopes of making the site a more inviting and entertaining internet utility — something that seems all the harder in the age of President Donald Trump.

The social network, which turned 10 last year, remains both a vital force for free expression on the web and yet also a cesspool of hate, abuse, and harassment. This imbalance has only become more visible during the first 12 months of Trump’s administration. An avid Twitter user even before becoming president, Trump has transformed his account into a warped and weaponized right-wing PR vehicle focused on cruel score settling and dangerous attacks on the basic institutions of democracy. In the process, Twitter has struggled with how to handle the behavior of a man who uses it to attack his political enemies, journalists, civilians, and the leader of North Korea in almost equal measure.

Twitter remains both a vital force for free expression and yet also a cesspool of hate, abuse, and harassment

On one hand, the company has said the same terms of service apply to Trump that apply to every other user. But it still seems unlikely that Twitter would ever ban the president. Even if the company were willing to withstand the backlash that would follow, Trump’s subordinates could still easily post his messages to the platform. In the meantime, Twitter has often fumbled its response to Trump-related controversies. The company let stand Trump’s veiled bombing threat directed at North Korea back in September, which critics said violated the company’s prohibition on tweets advocating violence. Twitter said at the time that its policy would need to be updated to reflect that it would make make exceptions for newsworthy tweets.

The controversy extended to Twitter’s response to anti-immigrant and Islamophobic rhetoric from the president. When the Trump retweeted anti-Muslim videos posted by far-right group Britain First last month, many wondered why Twitter did not act. Twitter initially said it kept the content up because it wanted “to help ensure people have an opportunity to see every side of an issue.” The company then retracted that statement shortly thereafter, with CEO Jack Dorsey saying the company “mistakenly pointed to the wrong reason” and that it would be “looking critically at all of our current policies.” Earlier in November, the company suffered a separate, equally embarrassing setback when a rogue Twitter contractor briefly suspended Trump’s account on his last day of work, raising questions about how its internal tools can be misused.

Twitter’s Trump trip-ups have taken center stage these past few months. But larger questions about Twitter’s inability to curb harassment and moderate speech has dominated discussions about the company in 2017. Twitter has gone to great lengths to try and curb abuse with soft touches, like letting users apply filters to their feed and making it easier to report harassment. But the results have been uneven.

Following the events of Charlottesville this past summer, in which hate groups marched together in Virginia and one counter-protester was murdered by a white supremacist, the company became embroiled in a murky debate over speech moderation. Twitter had in the past banned accounts for behavior that was either abusive or incited violence, resulting in the removal of accounts operated by high-profile alt-right trolls like Milo Yiannopoulos and Chuck Johnson.

Policing users and their tweets is a tricky balancing act

But Twitter found itself in the position of defending or appearing to endorse white supremacists and other alt-right members who built reputations on veiled attempts to promote incitement, hate speech, and other bannable offenses. The company paused its verification process after a Charlottesville organizer earned a blue checkmark, and it has since begun removing verification for a number of prominent white nationalists. However, Twitter is now forced to grapple with a new system of verification that involves judging users’ online and offline behavior. It’s a tricky balancing act. It inevitably means making bold character judgements and taking political stances on certain issues related to race, immigration, and other controversial topics. And it will certainly only cause more headaches down the line.

The combination of all these factors forced Dorsey’s hand this fall, with the Twitter chief laying out a long list of proposed changes related to safety that the company has now begun implementing. The list included updates to the company’s abuse and harassment reporting system and the transparency around account suspension. Earlier this month, Twitter began a new campaign to rid its platform of violence and hate speech, resulting in bans for the accounts involved with the anti-Muslim videos Trump retweeted.

Putting aside the dizzying number of controversies its weathered, Twitter’s business is still in rough shape, saved only by a static stock price. Shares have been relatively flat this year, but its market value is only one-third of its January 2014 high. The company’s user base has effectively plateaued; the company added just 4 million monthly active users last quarter, bringing its total user base to 330 million. (Facebook added more than 12 times that amount in daily active users in the same time frame.)

The news was not all bad. Moments has grown into a refreshing and digestible rundown of the day’s most popular tweets, threads, and hashtags. The algorithmic feed is doing a better job finding more popular tweets, and now tweets that go viral reach more people than ever. The recent introduction of a 280-character tweet limit has spurred more engagement, the company says. It remains to be seen whether these product changes have any substantial impact on user growth.

Salvaging Twitter is not going to get easier

Twitter’s future hopes remain largely invested in live video, which could conceivably bring the company both millions of new users and billions of dollars in revenue once reserved for television. The platform is giving editorial brands a robust video delivery mechanism for modern takes on TV, including a new 24/7 news network from Bloomberg. But after a multi-year push, it’s not clear that live TV has moved the needle for Twitter. Earlier this year, the company lost its NFL streaming deal to Amazon, which inked a new $50 million deal with the sports organization to stream games to Prime subscribers. Amazon’s streams since have outperformed Twitter’s from 2016. (Disclosure: The Verge has a partnership with Twitter to broadcast a weekly live video show for our gadget vertical Circuit Breaker.)

Despite its woes, 2017 illustrated that Twitter is as vital a source of news and commentary as ever. However belatedly, the company took bold steps toward policing behavior on the site and attempting to make it a more inviting, engaging, and civil place. Trump remains a problem for which Twitter has no clear or satisfying answer. And as it takes a stronger editorial hand in determining which users will be verified, it’s only going to get more complicated from here.

Salvaging Twitter is not going to get easier. But at the very least, the company has shown in 2017 that it is willing to keep trying.

Final grade: D+