Wahhabi fundamentalism and Naqshbandi Sufism also emerged as two very important forces that challenged Ottoman legitimacy in majority Muslim territories. With Napoleon’s arrival in Cairo, the southern tier—especially the Egyptian–Levantine coast—had achieved virtual autonomy that overturned the traditional Ottoman–Mamluk balance and carried Egypt into the world economy. The sultan was in control of very little territory except Anatolia, Bulgaria and Thrace. Mahmud II, however, proved more successful than his predecessor at dealing with the two major obstacles to a reconsolidation and transformation of Ottoman sovereignty. Mehmed Ali also oversaw the construction of factories during this period, intended as a means of achieving self-sufficiency in certain goods as well as of supplying the army. Arsenals and textile factories, sugar refineries, rice mills and tanneries were all established, starting in 1815. Simultaneously, the military and cultural interactions rendered Mehmed Ali of Egypt the new domestic challenger to the sultan’s survival.