refactor these to window.js (on appOpen) by earlier discussion.