Facebook Inc. will retire a controversial ad targeting option that let marketers reach users based on a “multicultural affinity” for certain racial and ethnic groups, including African Americans and Hispanics.

The company doesn’t allow advertisers to target users by race, but critics have argued that other features could help marketers work around that prohibition. Users can be solicited based on “multicultural affinity,” for example, a category based in part on data collected from their activity outside the Facebook app, such as purchase history and device usage, a spokesperson said.

The U.S. Department of Housing and Urban Development accused Facebook in 2019 of enabling discrimination by letting advertisers prohibit housing ads from appearing for users based on traits such as gender and race, a practice that is barred by law.

Two categories for “African American Affinity” and “Hispanic Affinity” are being removed as part of a general review of targeting options, the spokesperson said. Facebook still offers a way for advertisers to reach people interested in “African American Culture,” however, which is a category that takes into account the ads people click on and the Facebook Pages they follow, the spokesperson added.

Facebook has been attacked by civil rights groups in recent months, including the NAACP and Color of Change, for an alleged failure to enforce its policies around hate speech and misinformation, particularly related to African American users. During the lead up to the 2016 election, for example, African American users were targeted by Russian trolls with posts pushing voter suppression techniques.

Earlier Tuesday, Facebook released a report showing that 22.5 million posts had been removed from the social network during the second quarter for violating the company’s hate speech policies, more than double the number taken down during the first three months of the year.