Refactor TransitToNode method.