(maint) Move the interative functions shared behavior to common dir

This commit moves the shared behavior for iterative functions to
shared_behaviours/iterative_functions.