init code refactorization - global var

not really sure the purpose of this?