refactoring ajax calls
refactoring ajax calls