refactor AJAX call with a simple XHR instantiation