namespaces adjusted, unused references removed