I think you could shorten this logic to something like:
```ruby
largest_free_cluster = clusters.select{|c| c['running_job_ids'].length == 0}.max_by{|c| c['size']}
```