It would be good to split this into a separate function which returns a dict - e.g. `get_components_from_node_path.`