Improved dirty tracking