update optional arg handling to be more concise