tricky ajax parsing improvements