Optimize initGlobals to do only one merge call