Refactor iterator translation to its own class and apply it to InputFormats as well.