refactor into namespaces