Consolidate iteration logic to a single method