enhanced option parsing