Major namespace refactoring for backend