update iterator and callback function made optional