Always casting objects regardless of the actual type, especially when casting to string, can cause needless object generation which then has to be collected. It's possible that this value could be a symbol in which case this cast would be necessary, but I would rather only cast the ref to string if it's a symbol, like so:

```ruby
ref = ref.to_is if ref.is_a? Symbol
```