It’s been a rough few weeks for Slovakia. First, its capital is passed up as the new host of the European Medicines Agency (EMA) after Brexit in favor of Amsterdam. Then its finance minister, Peter Kažimír, resigns from the race for the Eurogroup leadership — a position that would have given the country a real seat at the table, for once.

Slovaks reacted to the bad news from Brussels with overblown self-flagellation. Bratislava, much of Slovakia’s commentariat agreed, was a terrible place to live — who would want to move there from London? And Kažimír was an awful candidate who is not doing enough to stabilize public finances at home (notwithstanding this year’s deficit, expected at around 1.29 percent of GDP) and has not been able to eradicate tax fraud in the country.

The double rejection came amid declining support for Prime Minister Robert Fico’s scandal-ridden government. The country seems increasingly torn between the Euroskepticism of its Visegrád neighbors, popular among some on the country’s political right, and Fico’s professed desire to position Slovakia firmly in the eurozone’s integration core.

Ultimately, the blow might end up doing Slovaks a favor. The country urgently needs to rethink its relationship to the bloc if it wants to rid itself of its image as Europe’s “biggest loser.”

There are grounds for optimism. Neither outcome — no matter how disappointing — sparked the outrage at “traitors” or out-of-touch cosmopolitan elites that usually follows controversial decisions out of Brussels. Not even Slovak politicians who harbor very little affection for the EU used the occasion to criticize the bloc.

There’s a growing appreciation of the fact that rejecting the European project — as Hungary and Poland have done — has little to offer to the small Central European country, whose political independence and freedom are inextricably linked with its membership to the bloc.

Slovakia will never be a large country and wield a voice comparable to that of Poland, let alone Germany or France. But it can be an influential country if it matches a commitment to EU integration with effective domestic reforms to update its public administration, health care and education systems. And if Slovak leaders also have a clear vision and strategy of what they are trying to accomplish in Europe.

Estonia, with its relatively corruption-free public sector and its uncontested ownership of the digital agenda in the EU, is a prime example of a small country with an outsized influence.

Slovak leaders should focus on topics where their country can add the most value to the bloc: the Eastern Partnership and the enlargement agenda. Slovakia’s underdeveloped Eastern regions are quite literally on the edge of the Western world. Few things are more strongly in Slovakia’s national interest than making sure that its eastern neighbor, Ukraine, becomes a successful and thriving economy.

The EU’s engagement with the Eastern neighbors has either stalled or been reduced to a technical exercise with no real political guidance. Countries like Moldova, Ukraine and Georgia — as well as the Balkans — are understandably cynical and demoralized.

Slovaks — with their memory of the role that the accession to the EU played in overcoming the double legacy of communism and Vladimír Mečiar’s authoritarianism in the 1990s — should be the ones making the case for boosting the EU’s regional engagement.

Missing out on the opportunity to host the EMA or to preside over the Eurogroup is a serious setback. But what matters now will be how its government bounces back and finds its voice in the bloc.

Dalibor Rohac is a research fellow at the American Enterprise Institute. He tweets at @DaliborRohac.