some structure & code mitigation to the main.js
nightly and not stable main.js app code