Parsing arguments is a logical unit of work so I moved it into a function.