Small step to using deferred objects
Converted from old-style AJAX methods to deferred objects style