main.js small reorganization in variable declarati

main.js small reorganization in variable declarations