Cleanup js code