move away from global switch
resolve global.