Avoid casting some generators to lists by restructuring some methods.