Re-factored the AJAX Action part