Optimizing more scripts