Optimized scripts a bit.