Moved out stuff, added settings and remade ajaxcall to promise