unified hasChild method