improve global variable snippet for initialization