multi-route script optimz