simplify replay loop