some refactoring on clirunner