[streaming] refactor sliding window