move next() in core into the closure