Refactored: toString, getChild, hasChild