optimize script using new run infrastructure