Get rid of explicit casting to NodeTrait, and just pass around references.
Update to work with new enum import syntax