By mid-2012, the insurgents had lost most of the territory they had seized, and a search for more permanent democratic institutions began. A new provisional constitution was passed in August 2012, reforming Somalia as a federation. The same month, the Federal Government of Somalia was formed and a period of reconstruction began in Mogadishu. Somalia has maintained an informal economy mainly based on livestock, remittances from Somalis working abroad, and telecommunications. It is a member of the United Nations, the Arab League, African Union, Non-Aligned Movement, and the Organisation of Islamic Cooperation.