Cleaned up the batch system a bit