I can rewrite this to:
```ruby
dir = dir.try(:downcase)
```