move option parsing to own function with own namespace