cleanup ajax.js to make sure it is clean code.