Iterator pattern.