if `hosts` is not nil, you can also use `hosts.empty?`