Things often get ugly in the comments that follow political news, but research based on reader comments in Utah suggests that anti-immigrant sentiment is on the decline.

Sociologists at Brigham Young University took a random sample of 1,768 comments on that followed articles on immigration issues over a two-year period. They analyzed the comments and coded them as presenting either extreme or moderate positions.

At the beginning of the study in 2007, 50 percent of the comments took extreme positions. But that gradually changed over time, dropping to about 1/3 of the comments by 2009.

“Interestingly, the proportion of moderate views emerged from anti-immigrant positions, suggesting public distaste for extreme anti-immigrant sentiment as the debate unfolded over time,” the authors wrote.

The study appears in the journal New Media & Society. BYU graduate Brian D. Harris authored the study with BYU sociology professor Ben Gibbs. Professor Charlie Morgan of Ohio University is also a co-author.