Refactor node_id to be a handle type