javascript file cleaning