AJAX sender to refactor