Refactor loop building code to make_loops()