Refactored ajax files