started refactoring to eliminate all the global variables in globals.js