Former President Barack Obama, in his first public event since leaving office, talked Monday about illegal immigration, Fox News and other issues but avoided directly commenting on successor Donald Trump.

“The overwhelming majority of Americans believe we are a nation of immigrants,” Obama said during a panel discussion at the University of Chicago.

However, he acknowledged that a majority of Americans also think immigration “should be done orderly and legally” and “feel frustrated” about immigrants “breaking the rules” and laws that would allow “cutting the lines.”

Obama cautioned about assuming some Americans in the immigration debate are “racist.”

The former president’s efforts to get Congress to comprehensively change U.S. immigration law failed, and his executive orders to allow some illegal immigrants to remain in the country have largely been held up in federal court.

President Trump, by contrast, is making a strong push to keep illegal immigrants from entering the country, out of economic and national security concerns.

Obama spoke for about an hour at the university, where he once taught as a law professor, leading a panel discussion with young Americans about civic engagement.

“It’s wonderful to be home,” he said, in the city where he began his political career. “It’s wonderful to be in Chicago.”

He also argued that the news media have become more polarized and that TV outlets are “reaffirming their [viewers’] realities in neglect of common realities,” with conservatives watching Fox News and liberals watching MSNBC.

He also conceded that his 2004 declaration, while still a senator, that America is no longer a blue-state/red-state country was, in retrospect, an “aspirational comment.”

Obama also argued that gerrymandering -- largely the process by which a state’s ruling party carves congressional districts to their political favor -- has hurt the democratic process.

And he said that money in politics, or so-called special interest groups, “dominate the political debate” in ways that don’t address the real concerns of the voters.

Obama suggested the situation appears to be made worse by a changing society in which individualism has taken over people being politically involved in their communities through civic groups like a Rotary Club or a Parent Teacher Association.

“People are less inclined to be part of the community than they used to be,” he said.