unified bulk import code