extracted methods to inser_edit.lib.php