playback refactoring and some fixes