Integrated the batch structure checker and made the main method testable