Move logic to CommandLine class