jquery and ajax improvements