init code refactorization - global var