I think it's much more readable if you check hasNode first instead of adding this ```selectBoolOrNone``` integer switching.