code cleanup in localAjax() handler