insert and delete template