Code cleanups for batch runner