The pirates did not have to fight with any central authority until the Alaouite Dynasty united Morocco in 1666 . The pirates did not have to contend with any central authority until the Alaouite Dynasty united Morocco in 1666 .