refactor for CLI split