use common iterator fn