js code cleaning