introduce more namespaces and automatic memory management