several refactoring

runProgramme and chekcCommandType