ensure clean and consistent "namespace" usage

- remove some missplaced ;
- ensure end of a namespace is clearly visible
- use same formatting when using namespace
Ideally we should also have an if statement in here. I always wonder whether to put the } on the same line as the else, etc.