improve options parsing