Implementing the generator APIs