added namespace setup and more fine grained, less error prone getter

@laurent-muchacho @matthew-andrews @commuterjoy 

should really be 2 PRs, but hey ho