optimizing useless javascript