basic logic for data import