Clean up the CLI logic some.