big refactor - use namespaces