split spec between fetching records and inserting records