Refactor preexecute for inserts