cli-version big refactoring