Facebook Chief Technical Officer Mike Schroepfer said the Cambridge Analytica scandal contributed to a cultural shift within social media platform.

Schroepfer told the Code Conference at Rancho Palos Verdes that revelations about the manipulation the Facebook platform during the 2016 election rattled the company’s optimistic ethos, causing Facebook to begin thinking about how malicious actors can abuse the platform.

“It’s the biggest cultural shift in the 10 years that I’ve been there,” Schroepfer said. “Top to bottom.”

Schroepfer and Chief Operating Officer Sheryl Sandberg revisited the now-familiar details of the privacy breach that has been the stuff of hearings before the U.S. Congress and the European Parliament, and talked about Facebook’s efforts to combat fake news ahead of the midterm elections.

“In 2016, people were worrying about spamming, phishing, hacking. We run a very good tech team. We were very good on that,” said Sandberg. “We didn’t see it coming — a different kind of more insidious threat. We realized we didn’t see the new threat coming. We were focused on the old threat.”

Sandberg said Facebook is working to combat fake news by eliminating the economic incentives of clickbait and deleting fake accounts that circulate spurious stories. These efforts have been effective, she said, in combatting the problem ahead of Senate race in Alabama as well as in France.

Facebook also has partnered with the Associated Press to monitor for bogus stories across all 50 states, ahead of the 2018 election in the U.S.

“We’re learning from our mistakes and we’re taking action,” Sandberg said. “We’re also humble. We have a different mindset, we have to look around the corner to see the next threat.”

Schroepfer said the experience said the ordeal has a wider lesson for Silicon Valley to think about the possible applications of the tools they create.

“The big cultural shift a lot of people in technology have to make,” Schroepfer said. “Is to think about this in advance, not after this thing has been created.”