Major ring buffer refactoring