simplify and unify the `insert_tpl`