Refactored buffer and thread_buffer, and more refactoring of strided_vals