refactoring starting app