clean up namespace and fix a bug in testing