code cleanup and remove sync xhr #3647