refactor Replay handlers.