some javascript cleanup