deploy script optimized