Improvements to Ajax Script