JavaScript cleanup