moved option parsing into its own function