pull out the insert result handling