refactor: do option parsing in an in-place block