refactoring, fixing cli