Gangs in Nairobi's notorious Mathare slum are attempting to reform as they struggle to survive in an environment that offers limited opportunities for young men.

According to the anthropologist Naomi Van Stapele, men living in Mathare tend to have less social and economic opportunities than their female counterparts. This trend is the combined result of post-colonial migration patterns that saw Mathare shelter a large number dispossessed rural women and the tendency of humanitarian organisations to focus primarily on empowering women instead of men.

Van Stapele, who has worked in Mathare for over 20 years, has written extensively on how young men from the area seek refuge in gangs in order to survive and strengthen their sense of identity and shared brotherhood.

Mathare gang-related economic activities consist primarily in participating in the illegal alcohol brewing business and getting involved in drug peddling, extortion and prostitution.

Gang membership excludes these youth from participating in other aspects of Kenyan society, relegating them to the confines of the slum. Women on the other hand have long held the reigns of both the illegal alcohol brewing business and other informal income generating activities and through formal savings groups and associations, have wider networks and stronger security nets on which to fall back in times of need.

In order to address this disparity, different local organisations have begun to search ways to focus on helping gang members reform and enter the formal job market. This action has been mirrored by a recent trend, which sees gangs attempting to achieve legitimacy by registering as youth groups.

"Gangs increasingly want to be seen as youth groups as this legitimises them and allows them space to operate within the law," says Samuel Kiriro, a founding member of the Mathare-based organisation Ghetto Foundation that works to rehabilitate gang members and provide training opportunities to help them enter the job market.

According to Kiriro, whose organisation focuses mainly on individuals but also works alongside a number of transitioning gangs: "Gangs want to shake off the image that they exist purely to extort money off residents."

A first step towards building trust in the community is generally to conduct neighbourhood clean-ups and garbage collection rounds, both services that the city council fails to provide. Yet by organising into youth groups - a process that involves significant effort because it requires writing down aims and objectives and handing in forms to government offices, the gangs begin to shift their outlook.

While initially their aims are mainly self-serving, the process of articulating who they are is important. It gives them perspective on their position of marginality, both in their community and in relation to the rest of the city.

"We focus on running community development projects," says Muchangi Nyaga, the chairman of a reformed gang known as Ghetto Green Foundation. Active since 2012, Ghetto Green began by collecting trash and then moved on to using performing arts to engage in peace initiatives and human rights awareness.

"While initially we were concerned in finding ways to raise money for the group, after a while we realised there were other important issues that also needed to be addressed," says Nyaga. "We felt that there was too much land grabbing and violence in our ghetto and that we should take an active role in preventing this from going on."

Nyaga was speaking during an interview that was attended by 12 different members of the foundation, all of whom were eager to describe the work they were doing with terms such as "social justice", "environmental concerns" and "civic education".

"It's not easy for these gangs to successfully make the transition," says Kiriro, adding: "I think the failure rate is quite high because even once they have passed the initial hurdles, they still have to continue making savings groups work and such activities require a lot of discipline."

However, despite the difficulty in making it happen, Kiriro is positive that groups can increasingly be incorporated into grassroots projects aimed at improving the lives of slum dwellers. His views are echoed by Van Stapele, who in a recent interview described how she believes there is a role for gangs in local development initiatives. According to her: "Gangs already initiate all kinds of development projects such as farms, toilets and even entire upgrading schemes. Also, they are part of almost all existing development projects as community members."

Van Stapele says that by effectively ignoring the role of gangs within the community, donors and governments are excluding important stakeholders, thus stoking tensions that inevitably result in problems and delays to the completion of a given project.

Join the community of global development professionals and experts. Become a GDPN member to get more stories like this direct to your inbox