a little javascript cleanup