In his cabinet position, Van Buren became a key Jackson advisor, and built the organizational structure for the coalescing Democratic Party. He ultimately resigned to help resolve the Petticoat affair, and briefly served as the U.S. ambassador to the United Kingdom. At Jackson's behest, the 1832 Democratic National Convention nominated Van Buren for vice president of the United States, and he took office after the Democratic ticket won the 1832 presidential election. With Jackson's strong support, Van Buren won the presidential nomination at the 1835 Democratic National Convention, and he defeated several Whig opponents in the 1836 presidential election. However, his presidency soon eroded with his response to the Panic of 1837, which centered on his Independent Treasury system, a plan under which the Federal government of the United States would store its funds in vaults rather than in banks; more conservative Democrats and Whigs in Congress ultimately delayed his plan from being implemented until 1840. His presidency was further marred by the costly Second Seminole War (a result of continuing Jackson's Indian removal policy); and his refusal to admit Texas to the Union as a slave state, done as an attempt to avoid heightened sectional tensions. In 1840, a surge of new voters—who nicknamed him "Martin Van Ruin"—helped turn him out of office.