refactoring cleanup check point
Added tests. namespaced vars to not play well.