refactor initialization and configuration of the application