refactored db and layout namespaces