Reorganized namespaces, added comments