refactored batchfiles