The case statement looks odd here. I guess it could be simplified like this:
```ruby
case command
when 'r'
...
when 'd'
...
else
...
end