Re-factored the AJAX Section