When President Donald Trump introduced a new immigration plan last Thursday, he told Americans that he wanted to shift the focus of the U.S. immigration system, going from giving many visas to families of those already here to a “merit” system. Under his plan, which he said would “promote integration, assimilation, and national unity,” the U.S. would require a civics test and make admission decisions on the basis of points for categories such as age, English proficiency, level of education and offers of employment.

While the plan — which is unlikely to pass Congress — would represent a big change for the current system, it would not be the first time the U.S. has used testing to make immigration decisions.

In his new book, The Guarded Gate, journalist Daniel Okrent explores the U.S. immigration system around the turn of the 20th century and shows how politicians came to embrace the racist junk science of the eugenics movement in order to keep their country the way they wanted. His study of the role of literacy and other tests in the service of immigration law exposes what he sees as a reason to be wary of such regulations today.

As the number of immigrants from southern and eastern Europe increased throughout the late 1800s, Massachusetts Senator Henry Cabot Lodge and others began to worry about their impact on American life.

“He thought the white race that founded the country, in his view, was under threat,” Okrent tells TIME.

So, once he moved from the House of Representative to the Senate in 1893, Lodge started really pushing the idea of a way to limit their numbers: a literacy test. But while his ideas found a positive reception in Congress, big business liked the cheap labor of immigrants and other politicians liked their votes; President Grover Cleveland vetoed the bill. As Lodge continued to advocate for literacy and language-based tests, three more presidents vetoed the idea too.

Still, this did not deter Lodge.

By 1917, anti-immigration campaigners actually succeeded in passing a literacy test. However, the intervening years meant that education had significantly improved in the eastern and southern European countries that Lodge and his colleagues were so worried about. Because they could no longer rely on literacy tests to keep immigrants out, they turned to something else: the eugenics movement, which used pseudoscience to claim that certain races and ethnicities were genetically and morally superior to others.

This fact revealed the truth about the earlier law, Okrent argues: Lodge’s literacy test had never been meant to keep out certain immigrants because they were uneducated. If that had been the case, the fact that these immigrants were now better educated would have solved the problem. Rather, those literacy tests — like the literacy tests given to black voters before the Voting Rights Act — were a mask for the desire to block people because of who they were.

Get your history fix in one place: sign up for the weekly TIME History newsletter

Eugenics gave anti-immigration advocates a new veil of legitimacy for their views, explains Okrent. The ideas of the movement were embraced not only by members of Congress, but also by many major universities and scientific institutions such as the American Museum of Natural History. The ideology swept the nation, Okrent says. People held baby contests and the government developed certifications that citizens could obtain to prove their genes were “superior.”

“They saw that this was a very convenient thing,” Okrent says. The messaging of Lodge and other eugenics proponents was: “Scientific authority is telling us these as facts, therefore it’s not because we don’t like these people, but we don’t dare let them corrupt the American bloodstream.”

As stark as these words seem today, these ideas were not limited to the fringes of politics. In fact, when Calvin Coolidge was about to become Vice President in 1921, he wrote a column in Good Housekeeping explicitly espousing these views. The result of the efforts of Lodge and his allies was the Immigration Act of 1924, which limited the overall number of immigrants coming the United States, imposed quotas on southern and eastern European immigrants and banned Asian immigrants outright. It fundamentally reshaped immigration in the U.S. for decades, until President Lyndon Johnson overhauled the immigration system in 1965 amid his Great Society programs and the Civil Rights Movement.

While there are significant differences between the anti-immigration fervor of the early 20th century and politics today, Okrent says these immigration policies still hold a lesson for 2019: when it comes to making immigrants pass an admissions test, he believes, it’s worth considering not just the test itself but whom it would affect — and how those people are treated by the system in general.

During his speech announcing the new immigration plan last week, the President said the proposed tests are meant to promote assimilation and help the nation’s economy. “America’s immigration system should bring in people who will expand opportunity for striving, low-income Americans, not to compete with those low-income Americans,” Trump said.

“I think it’s very clear that [today’s] policies are again aimed at keeping out people of a particular nationality or race,” Okrent argues of the Trump Administration’s new proposal. “Who is going to pass a civics test and speak English?” he says. “It’s more likely to be people coming from the nations that our President seems to be more comfortable with.”

Trump has previously described immigrants from Mexico “rapists” and “criminals,” called some undocumented immigrants “animals” and referred to Haiti, El Salvador and African nations as “shithole countries” when questioning why the U.S. was letting in people from those places.

The Trump Administration has not yet released the full details of its latest plan, and the current proposal is unlikely to make headway in Congress. But if history has shown us anything, Okrent says, that does not mean the conversation is over. After Lodge got his literacy test passed in 1917, it was only five more years until he enacted the sweeping quota system he so long desired.

“Those who want to keep immigrants out,” Okrent says, “will use whatever means they can to do so and come up with justifications to suit what is — not in every case, but in many cases — a belief in the inferiority of these people that they don’t want in the United States.”

Write to Abigail Abrams at abigail.abrams@time.com.