Adding ability to switch between insert & update