Improve adding a namespace by group