A much more elegant way of extracting the namespace