Refactor Namespace class