CLI refactoring and options