Move the sliding window logic to Instance.