refactoring cli from core module