Some javascript cleanup