scripts optimizations