Refactored client command line arg parsing to a helper method, fixed some issues.