further refactoring from CommandLine into Core
further refactoring from CommandLine into Core