DOM insertion improvement