use globalbuilder to avoid undefined global objects during optimization