maybe consider using enums for node_type and parent