don't use generators as they have weird support in Python 2.x