improve the batch and drush process functions