Improving handling of multiple namespaces in the same file