Pull initialization code out of begin block