refactored how double namespaces are prevented