Some refactoring to stop using document.app_namespace: I don't want to force myself to use this as a pattern to re-use these objects