Rearrange initialization of global variables.