simplify DOM insertion/deletion