Bit of a tidy up of the CLI code.