Remove redundant code in head childNode handling