Remove unnecessary tests from insertChildAt and inline it instead