extracted ajax calls in a single method