cleanup js code