script modifications, TODO discard the default namespace and fix static variable issues