Extracting ajaxRequest into a class method to allow for easier re-use