Tidy up option parsing