inlined the ajax calls