patterns in generators