CAN politicians make themselves unpopular by doing popular things? In the case of the Conservative Party the answer is: too right they can.

It developed the habit during a decade in opposition from the late 1990s, while Tony Blair was winning the centre ground and huge majorities for the Labour Party. The Tories lurched to the populist right, fulminating against the European Union, immigrants and gypsy encampments. These were—and are—deeply unpopular with British voters. Yet instead of rewarding the Tories for giving voice to their meaner thoughts, they handed the party defeats and viewed it, a Tory frontbencher conceded, as “the nasty party”.

That is why recent attacks by David Cameron, the Tory prime minister, on environmental policy and immigrants appear risky. Polls suggest these are popular targets. Yet the Tories’ record suggests they may not be election-winners.

Mr Cameron has long asked his ministers to reduce the steepling cost of household energy bills. On November 21st he was reported to have demanded that they do so by scrapping “all the green crap”—that is, surcharges to promote energy efficiency and renewables. His spokesman denied this represented the prime minister’s thoughts, but not that he had said it.

The issue is likely to get more play in the chancellor of the exchequer’s autumn statement, due on December 5th. The government aims to cut the average household energy bill by around £50 ($81), or half the amount added by green levies, principally by shifting an energy-efficiency provision onto general taxation.

With the average annual energy bill around £1,300, that would have little impact on household finances. Its main effect would be to suggest that Mr Cameron had abandoned the enthusiasm for tackling climate change which was once an important part of his effort to soften his party’s image. Green Tories are concerned. According to Greg Barker, the Tory minister for climate change, “We’ve got to make clear there’s a difference between green values and green value for money.”

The prime minister’s thoughts on immigrants are plainer. On November 27th he announced plans to make Britain’s welfare system less hospitable to foreigners. Newcomers to Britain would be unable to claim unemployment benefits for three months and risk losing them after six. They would be unable to claim housing benefit. Any convicted of vagrancy would be slung out. Much more ambitiously, Mr Cameron pledged to reform EU rules by making it harder for the citizens of new member-states to move freely within the union.

It is reasonable to worry about the issue. Most Britons want an end to the mass immigration that has added over 3m to the country’s population since 1997. Fears of a fresh influx of Romanians and Bulgarians, who will be free to move around the EU and work from January 1st, have intensified that concern, with the encouragement of a hostile press. “Enough is enough, Mr Cameron,” warned the Daily Mail.

Yet the risk for Mr Cameron is, again, that he will do more damage to his party’s standing than good. Even expelling every immigrant benefit-claimant would have little impact on net immigration. Just under 2% of people who arrived from the EU since 2010 have claimed unemployment benefit, according to the Labour Force Survey, as opposed to 6% entitled to it.

But the Tory brand is a proven problem—as the EU employment commissioner, Laszlo Andor, implied in his response to Mr Cameron’s announcement. Britain, he said, was in danger of being seen as a “nasty country”.