refactor(flatten): use `isNamespacedExpressionNode` utility method instead of keeping a copy