New implementation as a generator hook