Splitted iterator code into separate class.