continue refactoring out CLI code from core code.