replace obj.next() with next(obj)