Refined AJAX setup