refactor the cmdparser module