Added some more refactorings to the CLI