Nrcan namespaced Xpah and conversion logic code

and a bit of refactoring