Much of the reporting and analysis on the Alabama Senate race has focused on President Trump. But the fact is, the president wasn't the biggest factor, or even the second- or third-biggest factor, in the outcome.

Alabama politics determined the Alabama race. And in the showdown between Luther Strange and Roy Moore, there was an Alabama character who played a bigger role than the president or anyone else. That character was former Governor Robert Bentley.

Bentley's time in office ended in scandal on April 10, when he resigned upon pleading guilty to using state resources to hide an affair he was having with an aide. Two months earlier, on February 9, a scandal-plagued Bentley appointed Strange, then the Alabama attorney general, to fill the Senate seat vacated when Jeff Sessions joined the Trump administration.

It looked like a shady deal from the start. At the time of the appointment, Bentley was under investigation by the Alabama attorney general's office. Strange was attorney general. In the middle of the investigation he was conducting of the governor, Strange went to interview with Bentley to be the new senator. In addition, Strange had asked the Alabama legislature to hold off on impeachment proceedings against the governor while the attorney general's office investigated. And then he accepted the Senate appointment.

"The whole thing stinks," one top Alabama Republican said at the time. Although all involved denied any wrongdoing, the scandal stuck not only to Bentley but to Strange.

It stayed stuck on election night. "The Bentley appointment added about 30 percent to [Strange's] name ID, and none of it was very good," said a senior Republican familiar with the campaign. "The Bentley issue was a noose around his neck -- it never got shook, and was the most dominant feature of the campaign."

When a campaign polls, it often asks voters for a word they think best describes the candidate. Then they make a word cloud of the responses.

The top word, by far, in Strange's word cloud among Alabama Republicans was "Bentley."

The top three words in Roy Moore's word cloud were "judge" and "conservative" and "firebrand."

Given that, and in a GOP primary, it does not take a soothsayer to predict how that race is going to turn out.

Alabama-based journalists also see the Strange-Bentley connection as the most important factor in the race.

"Luther Strange's candidacy was tainted from the day he accepted the appointment from Gov. Bentley," Leada Gore, who covered the race for AL.com, told NPR Wednesday. "That one fact doomed him. I don't know if [the election outcome] was a love affair with Roy Moore as much as a rejection of Luther Strange and Robert Bentley."

"That played a huge part," AL.com columnist John Archibald added on NPR. "It looked terrible…[The appointment] stuck to him like tar and he could never get around it."

The optics of the case, the observers believe, were so bad that the facts almost did not matter, because the public made an assumption of corruption.

"Both of them deny it," Archibald said of Strange and Bentley. "It was never proven. But everyone in Alabama believes it."

Of course, there were other factors in the race. The two other top words in Strange's word cloud were "McConnell" and "Trump."

"McConnell" -- that would be the Senate majority leader -- was a burden on Strange. The GOP chief is deeply unpopular among Alabama Republicans. Not much that McConnell has done in the past few months pleased them; the coup de grace was choosing election day to throw in the towel on repealing Obamacare.

Another factor was the contrast between Strange and Moore on the stump. Say it this way: On the scale of political electricity, Moore has about a million watts more than Strange. Republicans who wanted to be enthusiastic just didn't find much in Strange's stump performance to get fired up about.

"I knew a lot of people who were trying to be for him, but they would go to an event and they would say, 'This guy is like watching paint dry,'" one conservative Alabama politico (and Strange voter) said Wednesday. "He got no one excited about him."

So after all that, what role did Trump play? Insiders believe the president did help boost Strange's standing. But the benefits of Trump's Friday-night rally in Huntsville did not last until voting began Tuesday morning. And that suggests that Trump's strength in Alabama -- a state he won by 18 points and where he has sky-high approval -- could never outweigh Strange's negatives.

There is a lot of morning-after psychoanalysis going on about the voters' attitudes. With both candidates pledging support for the president's agenda, Alabama Republicans appeared to decide that Moore was the Trumpiest candidate in the race -- even if Trump himself didn't yet realize that.

But in a race in which both candidates strongly sided with the president, the Trump factor just didn't play a deciding role. "It had little to do with Trump," noted that senior Republican.

Of course, Trump doesn't see it that way. There are reports the president is unhappy that he was talked into traveling to Alabama to campaign for Strange. And Trump famously expressed ambivalence about it during that speech in Huntsville.

"I might have made a mistake, and I'll be honest, I might have made a mistake," Trump told the crowd. "Because, you know, here's a story: If Luther doesn't win, they're not going to say we picked up 25 points in a very short period of time. They're going to say Donald Trump, the president of the United States, was unable to pull his candidate across the line. It is a terrible, terrible moment for Trump. This is total embarrassment."

Now, sure enough, much of the analysis on the race is focused on Trump. Has Trump given birth to an anti-establishment movement that will consume the GOP? Does Trump have less clout than he thinks, even in the states that most support him? Do Trump's bomb-throwers -- Steve Bannon, Sarah Palin, and others who campaigned for Moore -- have more mojo than the president?

All of that is fine to discuss. But when it comes to why Alabama voted as it did, remember -- it was first and last an Alabama story.