More code changes to acoomodate batching