It's been five years since four attackers made their way into Westgate, a popular shopping mall in the rich Westlands area of Nairobi, and unleashed a coordinated attack that left 71 people dead.
Some of those deaths resulted from friendly fire as the small group of terrorists took advantage of Kenyan security agencies' confused response. After the attack, videos emerged of members of some security agencies looting shops in Westgate during the siege.
Five years on, the threat is somewhat reduced.
Al-Shabaab remains undefeated. But there are several indications that Kenya, as well as several of its neighbours, such as Djibouti, Uganda, Tanzania and Ethiopia, have made important gains against the terror group and its local sympathisers.
My field studies indicate that the Kenyan police have been successful in curtailing communication and cross-border travel by local sympathisers and Somali militants. This is significant for two reasons. First, attacks like Westgate were almost certainly coordinated by militants who'd trained in Somalia and returned to Kenya. And second, hundreds of Kenyans have joined the group inside Somalia.
Kenya's security forces must nevertheless remain vigilant. This is especially true because Al-Shabaab remains powerful and stable within Somalia. There's always a risk that the group will once again turn its sights on Kenya if policing and security slacken.
Al-Shabaab, a border problem
After Westgate, Kenya was rocked by two more large attacks in the vulnerable border areas near Somalia. On 2 December 2014, gunmen crept into a labourers' camp in Mandera and killed 36 people. On 2 April 2015, militants launched a large-scale attack on Garissa University College. The attack left 150 dead, the highest number of causalities ever inside Kenya.
Since then, the border areas have become far safer, although attacks still occur. There are several reasons for this. Kenya increased spending on security. It also increased border controls, and implemented a devolution process delegating power to the region and local levels.
There's also been an improvement in relations between Kenyan police and communities. Civil society groups were also drawn into implementing Kenya's National Strategy to Counter Violent Extremism in 2016, leading to a variety of NGOs getting involved.
Finally, Kenya's police have become better at targeted operations. Gone are the random arrests scores of Kenyan Somalis that led to grievances and animosities that Al-Shabaab could take advantage off.
That's not to say Kenya is entirely out of the woods. Concerns persist.
Al-Shabaab, still a threat
One area of concern is that there's still potential for Al-Shabaab to recruit fighters inside Kenya. The root causes for the recruitment, alientation and animosity towards the state is still there.
While these Kenyan sympathisers in general are disorganised, they nevertheless remain a cadre that can be tapped by radicals if circumstances change in Kenya, and if law enforcement agencies drop their guard.
Inside Somalia, Al-Shabaab has not been weakened since the Westgate attack. There have been some changes, such as to its leadership, and some internal discord has been reported, but by and large the group remains on firm footing.
This is evidenced by increasing insecurity in Somalia. Most recently, a car belonging to Somali intellectual and free speech defender Professor Yahya Hagi Ibrahim was bombed. His brother was killed. It was the latest in a series of attacks targeting politicians and intellectuals.
In the Somali countryside, in supposedly "liberated areas", Al-Shabaab still wields considerable influence. For instance, the group demands "taxes" from villagers and protection money from businesses operating in those areas, helping to fund the group's activities.
All of this is worrying for Kenya. Its own local improvements unfortunately won't directly influence Al-Shabaab's standing inside Somalia.
Maintaining the progress
Kenya's leaders need to maintain unity and enhance both the payment of security forces and the trust between community and the police.
Progress has been made, but it needs to be continuously advanced, strengthened and consolidated.
Stig Jarle Hansen, Norwegian University of Life Sciences