application startup and code refactoring