Refactored how the app starts