refact optparser usage