refactoring ajax hw