Refactored for use of namespaces