updated application flow and logging