[internal] use destructuring for option parsing