batch import refactored