Factoring iterator behavior for clarity