Refactor application start and global options.