Refactoring compiler to create separate iterator and builder classes.