reformat JS code