Improve application initialization. Add advanced logging