use generators to lazily fetch tasks