some more cli refactoring