1. resolve the definition of the node 2. walk&check the code for references Possible optimisation: - don't track references for vendor code - compute references and cache them