javascript cleanup