Dealing with the situation of having fewer content items than ``qty`` could be done a bit better than with this ``loop_count`` variable. Something like the following makes more sense to me:

```ruby
total_items = data.values.flatten.count
while push_count < [qty, total_items].min do
  ...
end
```