Move option parsing into separate method