move Variables initialization code into a function so it can be replayed