refactoring cli tests