Iterator hell-like realization.