Instead of `sort_by{|x| x.length}.reverse.first`, you could equally use `max_by(&:length)`.