extract the option parsing functionality to its own class