update namespaces and move logic out of main.js