Factoring out ajax call for future test case

A bit of refactoring never hurts!