Making robust Batch class and removing old files