reuse loop fn with foreach