Namespace and minor refactor