McKINNEY, Texas — In a sharp departure from his fiery, "abolish the IRS" presidential revivals, Sen. Ted Cruz, R-Texas, opened a forum on veterans issues just after Independence Day by touting the strength of his constituent services operation.

It was a subdued and earnest senator, part of Cruz's concerted effort to repair an image that took a huge hit in Texas in advance of running for re-election in 2018, in part because of memories of his hostility toward President Trump.

Gone was Cruz the ideological warrior, who cultivated a national base by railing against his party's establishment and scorning his Republican colleagues — often by name, a breach of time-honored Senate decorum.

So, nearly four years after defying Republican leaders to lead a government shutdown aimed at forcing former President Barack Obama to defund his signature healthcare law, Cruz was telling a mostly friendly crowd that he was negotiating a compromise on legislation to partially repeal Obamacare.

"It's been messy, it's been bumpy. I am not certain we'll get it done. I hope we will; I believe we will," Cruz said to about 200 constituents, in a hotel conference center just north of Dallas, describing the talks among Senate Republicans to find 50 votes for a bill.

Cruz, 46, hasn't shed his conservatism. During this pre-screened town hall, sponsored by the conservative group Concerned Veterans for America, he called the Affordable Care Act a "manifest disaster."

As with others on the Right, Cruz is pushing for a more aggressive repeal of the law than would occur under the initial draft of the Better Care Reconciliation Act, saying it would reduce skyrocketing premiums and expensive deductibles.

But rather than serving up the red meat that was a staple of his public appearances from his rise in 2012 as a Tea Party upstart Senate candidate, through his runner-up bid for the Republican presidential nomination, Cruz responded to the few critics in the room with a sympathetic ear and pragmatic tone.

"This is an issue that inspires passion, and quite understandably. People care about their healthcare; it's personal," Cruz told reporters after the forum. "I hope it was helpful in explaining some of the differences in policy solutions that we need to respond not to the demagoguery and fear mongering which this issue, sadly, provokes in some circumstances."

The event was one of three such forums Cruz attended as a guest of Concerned Veterans for America, an organization that is part of the Koch brothers umbrella of political groups, during the July Fourth congressional recess.

It had some of the trappings of Cruz's presidential campaign.

His father, Rafael Cruz, a fixture of the 2016 trail, was in attendance, and the senator lingered for an hour after the event to shake hands with voters and take selfies, as Brooks & Dunn's "Only in America" and Toby Keith's "Courtesy of the Red, White and Blue" blared in the background.

Cruz even cracked a few of his trademark jokes that always go over well in a conservative crowd. "It's like anytime I talk about the Second Amendment in Texas, I'm afraid that people will pull out their guns and start shooting in the air," he said, to a round of laughter.

Yet it was a decidedly low-key affair, dominated by Cruz focusing on his work to improve the Department of Veterans Affairs and the services the agency provides to military veterans, and other apolitical priorities.

"Dealing with the leviathan that is the federal bureaucracy, it can be confusing, it can be frustrating, it can be maddening," Cruz said. " I can tell you, in our Senate office, we have an extensive team that is devoted to constituent services, and it's a team with a lot of experience."

Cruz's rehabilitation effort is serious. In June, a University of Texas/Texas Tribune poll showed that more voters strongly disapproved of how Cruz was doing his job (35 percent) than strongly approved (21 percent.) Nine percent somewhat disapproved; 21 percent somewhat approved.

Texas is still reliably Republican. But the senator emerged from the national campaign underwater with independents and in trouble with Republicans. The party faithful didn't appreciate his refusal to endorse Trump during his speech at the GOP convention in Cleveland.

Cruz backed the president about six weeks before the election, but it's taken longer than that to rebuild his standing at home.

The senator is almost back to normal among Republican voters, well enough to discourage any sort of serious primary challenge, GOP sources say. The general election is another matter.

It's not that Cruz is in danger of losing to his likely Democratic challenger, Rep. Beto O'Rourke. Rather, he needs to win big in 2018 to maintain his national political viability. That could be difficult if Trump's job approval ratings don't improve.

Trump won Texas by 9 percentage points, less than Mitt Romney's 16 points in 2012 and Arizona Sen. John McCain's 12 points in 2008. With Trump's approval ratings hovering around 40 percent nationally, he could hurt Cruz in 2018.

"That's why Ted is being the local senator," a GOP operative said. "He needs to be able to say with a straight face that he's helped state, while holding true to his conservative roots."