refactored buffering and pausing