Refactor replay