refactored to use namespaces