Replay logic refactoring (had to upgrade messaging aswell)