Kenyan President Uhuru Kenyatta gives a speech Tuesday in Ongata Rongai, a town south of Nairobi, after the country’s Supreme Court on Friday invalidated his presidential election victory. (Dai Kurokawa/European Pressphoto Agency)

Patrick Gathara is a strategic communications consultant, writer and award-winning political cartoonist in Kenya.

On Friday, Kenya became only the third country in the world (and the first in Africa) to have its courts annul a presidential election. The Supreme Court’s shock announcement that it was invalidating the Aug. 8 reelection of incumbent President Uhuru Kenyatta has left many in the country giddy with excitement. But perhaps they shouldn’t celebrate too hard.

That the annulment is a big deal — and worth celebrating — is not in doubt. It has overturned a seeming injustice and strengthened the country’s democratic credentials. And by cementing the judiciary’s independence from the executive, it has increased the likelihood that future electoral disputes will be litigated in the courts rather than in the streets. That significantly reduces the risk of post-election violence of the sort that killed more than 1,300 people following the disputed 2007 presidential polls. The then-opposition regarded the judiciary with deep distrust, and its corresponding refusal to refer the dispute to the judges undoubtedly fueled the unrest.

The court’s reason for invalidating the poll is also important. It ruled that the country’s electoral body failed to carry out an election that was faithful to Kenya’s laws and constitution. This, too, is a biggie. By holding that the electoral process is as important as the result, the court strikes a blow against the irregularities and outright illegalities that have afflicted Kenyan presidential elections since 1992.

The significance of this cannot be overstated. Last year, Samuel Kamau Macharia, the owner of the largest private radio and television network in East Africa, told the country’s Senate that only one of the five presidential elections held between 1992 and 2013 delivered the presidency to the candidate who received the most votes. That sole exception was the vote in 2002, which saw such an overwhelming vote against Kenyatta (who had been handpicked as successor to the unpopular dictator Daniel arap Moi) that the regime had little choice other than to concede.

Elections today are much more closely fought, and the electoral infrastructure is much more elaborate. Methods for stealing them, too, have become more intricate and difficult to detect. The integrity of the process has therefore become more critical than it was a decade and a half ago. By protecting it, the Supreme Court will force election officials to pay much closer attention to the process rather than the product.

Despite all this, however, the news is not entirely good. One of the allegations put forward by those challenging this year’s result before the court was that Kenyatta had abused his office by using public resources and officials to campaign. The court judges appeared to gloss over this in their judgment when they cleared him of any wrongdoing despite glaring proof.

Of particular concern, furthermore, is the potential for backlash from a stung executive. “If you rattle a snake, you must be prepared to be bitten by it,” one cabinet minister warned in 2006. Kenyatta is now threatening to bite. His lawyer has described the ruling as a judicial coup d’état, and the president has taken to calling the Supreme Court judges “wakora” (bandits). “[Chief Justice David] Maraga and his thugs have decided to cancel the election,” Kenyatta fumed on Friday. “Now I am no longer the president-elect. I am the serving president… Maraga should know that he is now dealing with the serving president.” A day later, he thundered ominously: “We have a problem with our judiciary. … We will fix it.”

Whether it is Kenyatta or his closest rival, Raila Odinga, who wins the redo election two months from now, the independent judiciary will probably become the target of an executive branch used to getting its way. Given, however, that his party is already firmly in control of both houses of parliament, Kenyatta poses a particularly grave threat. It is a reminder that Kenya still has a long way to go before it can get rid of its entrenched culture of impunity.

A fresh presidential election has been set for Oct. 17. Unfortunately, the task of organizing it still falls on the electoral body the Supreme Court has just discredited. Given that there is little time to make significant changes to either personnel or the existing electoral infrastructure, there are few guarantees the same issues won’t crop up again. And the court has yet to release its detailed judgment, which could precipitate an avalanche of legal challenges to gubernatorial, parliamentary and county races, as well.

The media will be key to ensuring that opportunities for malfeasance are minimized in the coming election. Rather than simply regurgitating the numbers coming from the electoral commission headquarters in Nairobi as they did three weeks ago, the media should set up their own tallying center. And they should be prepared to call the election independently, based on the figures publicly announced at polling stations and constituency-level tallying centers, as a check on the commission.

The Supreme Court judgment has opened up possibilities for a better future. Kenyans can be proud of that. But one decision does not a democracy make. And there is far more work to do if Kenya really wants to become a society that truly caters to the needs of all its people, not the desires of a few at the very top.