Revert "Use $.when with chaining"

This reverts commit 088652590faccb88f15d6cd2049aec7e2330662d.