Since the AJAX call is not tightly couples to this, consider parametarizing this and line 39 into a function called by both.