YouTube is taking steps to prevent disturbing videos from reaching children, after a wave of media reports showed how the platform was failing to keep inappropriate content away from youngsters.

“In recent months, we’ve noticed a growing trend around content on YouTube that attempts to pass as family-friendly, but is clearly not,” wrote Johanna Wright, YouTube’s vice president of product management, in a blog post dated Nov. 22. “While some of these videos may be suitable for adults, others are completely unacceptable, so we are working to remove them from YouTube. “

Wright states that the company has terminated 50 channels and removed thousands of videos, under an expanded set of guidelines for determining whether content endangers minors. It has also removed advertisements from 500,000 exploitive videos under these expanded guidelines.

In addition, the company will apply “machine learning technology and automated tools” in order to discover potentially exploitive content, as well as more human oversight. It will also disable comments on videos that have attracted predatory remarks from viewers.

The changes come after a number of media outlets published pieces describing YouTube channels that produce content exploiting children. Many of these videos were surfacing on YouTube Kids, a version of YouTube that bars age-restricted content.

Some of these channels placed beloved characters from pop culture in disturbing scenarios, in a genre known as “ElsaGate.” YouTube’s algorithms would surface these videos next to harmless, child-friendly content. A child watching a series of videos of Peppa Pig might stumble upon a channel that shows the character drinking bleach. Earlier this month, YouTube said that it would increase age-restrictions on such content on its main YouTube service.

Other videos show adults placing children in disturbing, uncomfortable situations. Toy Freaks, for example, was a channel in which a single father uploaded clips in which he scared his daughters while bathing, or dressed them up as infants. The channel had 8 million subscribers before YouTube took it down last week. “While it is disturbing to me that anyone would find inappropriate pleasure in our video skits, I deeply appreciate YouTube’s concerns for my family and I could not be happier with having had this remarkable experience,” the channel’s creator told Variety on its removal.

In her statement, Wright stated that YouTube will continue to work with the National Center for Missing and Exploited Children (NCMEC) to report potentially illegal behavior to law enforcement.