add special cases for empty iterables