Refactor in insertRecords, implementing  args