Command line controller and test refactoring