refactor repeater workflow

the main goal of this is to make it more testable / callable from
other contexts. just pulling stuff out into another function and
refactoring where needed/appropriate