When searching for historical analogues to the Trump presidency, political analysts have landed again and again on Andrew Jackson. For both men, an obsession with personal honor triggers their volatile temperaments. Their political appeal is tied to their opposition to the Washington establishment. And Jackson set the precedent for politicians to use a populist appeal to frame their rhetoric.

But while it’s easy to see how President Trump fits the model of an out-of-nowhere populist seizing power, there has been little attention to the way Trump is mirroring Jackson’s more impressive feat: chasing (and in Jackson’s case, winning) reelection as an outsider after four years as the ultimate insider.

Starting with his first presidential campaign in 1824, Jackson relied on his appeal to the “common man.” In 1828, it worked: Jackson became the nation’s first president elected thanks to populist appeals against a corrupt political elite rather than a coherent policy agenda. Once in office, however, Jackson faced a different challenge. He had to somehow avoid being branded as part of a corrupt elite — something he accomplished by implementing policy that emphasized his appeal to the “common man.”

A prime example: Facing reelection in July 1832, President Jackson vetoed a bill to recharter the Bank of the United States. Henry Clay, Jackson’s nemesis and the opposing presidential candidate, had pushed the bill through Congress. Clay assumed that the bank enjoyed public support and that if Jackson dared veto it, it would be the death knell for his bid for reelection.

But Clay miscalculated. Jackson used his veto as a populist appeal to his base, depicting himself as the champion of the “common man.”

“It is to be regretted that the rich and powerful too often bend the acts of government to their selfish purposes,” he wrote when he vetoed the bank charter four months before the 1832 election.

The move shouldn’t have surprised Clay. Jackson had attacked the policies of his enemies in Congress and former president John Quincy Adams by using the veto more than all six of his predecessors combined.

Jackson presented the actions of his first term as a successful but ongoing fight against the political elites. Jackson blamed the dysfunction of his first Cabinet on the corruption and failures of elites and pointed to his reliance on a “kitchen cabinet” of loyal supporters outside the Washington establishment as evidence of his distance from Washington insiders. He also touted his opposition to the Supreme Court’s 1832 decision in Worcester v. Georgia, which affirmed the Cherokee tribe’s rights to its land, demonstrating that “the people” he represented were white Americans intent on spreading across the continent. While only some of Jackson’s policies can be described as populist, his rhetoric consistently was.

Like Jackson, Trump does not offer voters policies grounded in any clear ideology. What he offers instead is a moral appeal: telling his base that they are the keepers of American virtue, the defenders of “the people.” And like Jackson, thanks to his rhetoric, Trump has thus far avoided being tarnished as part of a corrupt elite, relying on a populist appeal to “drain the swamp,” even as he proposes policies to enrich the wealthy.

He has been able to avoid this tarnish because he uses a populist appeal to frame his policy actions. To bolster his support in “coal country,” Trump pulled out of the Paris climate accord, claiming, “I was elected to represent the citizens of Pittsburgh, not Paris.” His attacks on free-trade agreements, most notably NAFTA, blend populism with personal vendettas, as he attempts to undo policies associated with the Clinton and Obama administrations.

And just as Jackson did with his dysfunctional Cabinet, Trump reframes failures as evidence of his outsider status. When Congress failed to “repeal and replace” the Affordable Care Act, Trump used it as evidence that Washington is controlled by a corrupt elite, one that continually blocks him from acting in the interest of hard-working families.

But his current push for tax reform shows how thin the populist skin overlaying his policies is. Trump presents the plan as beneficial for the middle class, despite the fact that the tax cuts he is proposing would primarily benefit the top 1 percent. Even in this, Trump echoes Jackson. Jackson’s populist appeal in opposing the bank disguised the fact that its destruction had long-term ramifications for the national economy, leading to the Panic of 1837, which was characterized by a major recession, unemployment and falling wages and profits.

In 1832, Jackson’s populist appeal resulted in his overwhelming reelection, as his style defeated Clay’s substance. He was able to do this because as president, he deftly avoided being tarnished as part of the elite, despite his insider political status.

Is this a model for Trump? Possibly. But unlike Jackson, Trump is actually keenly interested in helping wealthy elites, in large part because he’s one of them. This makes governing like a populist, rather than just speaking like one, a tougher task for Trump. Nevertheless, following Jackson’s example may be the only path Trump has to reelection.