named generator function for improved debugging