Another attempt at lazy app initialization

Hi! 

I hope this'll pass tests, it's very simple modification really.

Andrew