refactor(ui): factor out app initialization