Namespace and internal class refactoring