cleanup in static js code