refactored options parsing out.