WHITE SULPHUR SPRINGS, W.Va. - Rep. Evan Jenkins (R-W.Va.), left, Rep. Greg Walden (R-Ore.), and Rep. David B. McKinley (R-W.Va.) participate in a news conference at the GOP retreat. (Alex Wong/Getty Images)

President Trump stood in a packed ballroom, grabbed the podium and grinned before a crowd of Republican lawmakers.

"You folks have done well," Trump told them Thursday, referring to "some numbers" he'd just seen. "You've even done better than you thought, I think, based on what we just saw about 10 minutes ago."

The crowd chuckled in knowing relief: Republicans left their annual policy retreat Friday affirming they have finally found solid footing after a roller-coaster year that left them reeling politically and fearing the loss of their congressional majorities.

The December passage of a massive $1.5 trillion tax cut, rebounding polling and economic numbers, and resilient fundraising have GOP leaders more confident they can keep control of Congress in November's midterm elections.

"It feels like it's bottomed out and we're coming back up," said Rep. Greg Walden (R-Ore.), a former chairman of the National Republican Congressional Committee.

Even as Republicans left the retreat with a jolt of optimism about the midterms, the divisions and distractions that slowed their legislative agenda in 2017 and created political headaches threatened to complicate the next nine months.

Friday's furor over a newly declassified memo by Republicans on the House Permanent Select Committee on Intelligence, which alleges missteps by the FBI, highlighted pitfalls amid the promise. To many GOP lawmakers, the memo's release was a rare chance to seize control of a narrative that has vexed the party for more than a year. Others, particularly in the Senate, found reason for caution or concern.

In one critical statement, Sen. John McCain (R-Ariz.) urged his colleagues not to view the pending investigations into the Trump campaign and Russian political influence "through the warped lens of politics."

Other major obstacles remain for Republicans: a divisive fight on immigration that could alienate the party's conservative base or more moderate swing voters, a lingering "enthusiasm gap" with Democrats, a continuing string of lawmaker retirements and the biggest question mark of all: Trump himself.

For now, though, many Republicans are relieved to be treading water after a deluge of negative indicators over the past year.

The "numbers" Trump referred to was a new batch of national polling from Monmouth University that showed only a narrow, two-point edge for Democrats in the generic congressional ballot, said Rep. Steve Stivers (R-Ohio), the current NRCC chairman who said he showed Trump the figures before the speech. It also showed an uptick in Trump's popularity, although it still remains historically low.

"That's one example of how things are getting better," Stivers said.

Stivers made a 90-minute presentation to about 50 fellow House Republicans on Thursday, in which he underscored three main messages, according to a Republican familiar with the gathering: Be ready, sell tax restructuring and run a good campaign.

Part of his briefing was dedicated to the lessons the party has learned from election losses the past year, said the Republican, who spoke on the condition of anonymity to describe a private session. Stivers mentioned interviews his team had conducted with Republican state delegates who lost in the Virginia elections. Part of the problem was those candidates had nothing to sell as a signature party achievement, like Republicans are now trying to do with the new tax law.

"The economy's strong, unemployment's low, wages are up, bonuses are up. I mean, all those things people will be able to go run on," Walden said.

At one point, Stivers presented a slide of recent battleground polling that showed House Minority Leader Nancy Pelosi (D-Calif.) in worse shape politically than Trump. Part of the Republican strategy this year will be to try to tether Democratic candidates to Pelosi.

House Democrats need to pick up 24 seats to win back the majority, a number they say is within their reach, given the president's unpopularity and historical trends that have worked against the party controlling the White House in a president's first midterm. They say their own polling shows Trump and House Speaker Paul D. Ryan (R-Wis.) as anchors on GOP candidates.

"No amount of petty and pathetic attacks will mask the lethal combination of a Republican Congress held captive to a special interest agenda and a president with historically abysmal approval ratings," said Pelosi spokesman Drew Hammill. "You cannot sustain a majority on such a pathetic and desperate strategy."

The message from Trump, Vice President Pence and GOP leaders throughout the gathering was to focus on the accomplishments of the past year as the midterm season kicks into gear. But that is a risky bet that Trump's controversies will not eclipse those matters as the elections grow near.

The president's proclivity for stoking fights that many Republicans view as distractions; a special counsel investigation into Russian meddling in the 2016 election that has reached deeper and deeper into Trump's inner circle; and the potential for unexpected political storms, which emerged time and again last year, could foil their plans.

At the retreat, lawmakers heard a presentation from Defense Secretary Jim Mattis and Secretary of State Rex Tillerson that emphasized the importance of American engagement in the world, strong alliances and the crucial role of NATO, according to Rep. Charlie Dent (R-Pa.).

"But I just couldn't help but note that the president seems to contradict many of those statements through his own tweets and actions," Dent said.

Republicans say their 51-to-49 Senate majority is in less danger than control of the House. Democrats are defending 26 seats, including 10 in states that Trump won in 2016. Only eight GOP-held seats are on the ballot this year.

Rep. Evan Jenkins (R-W.Va.), who is running for the Senate against Democratic Sen. Joe Manchin III in a state Trump won by 42 points, said Republicans were upbeat coming out of the gathering.

"We all feel like this country is on the right track," said Jenkins, who quickly mentioned Trump by name.

On other topics, it's less clear what the party's predominant message will be. On immigration, Republicans departed the resort fragmented between moderates who have gravitated toward passing a narrow plan that protects young undocumented immigrants and beefs up border security, conservatives who favor Trump's plan that also places new limits on legal immigration, and hard-liners who say the party ought to adopt an even more hawkish proposal.

"I know that conventional wisdom holds that the upcoming midterms are going to be a challenge, right?" Pence said in a speech here. "But I think you all know what President Trump thinks about conventional wisdom."

Erica Werner contributed to this report.