Broke out functions in global.js