Refactor CommandLineInterface