use generators instead of iterable objects