move namespace and ID check to somewhere more appropriate