purge obsoleted code
insert & presave rewrite