More refactoring and playing around with the CLI.