split out arg parsing to own method