Wrap the initialization code in its own function.