Refactor startup & options parsing