minor refactoring to CommandReader