Improve Invalidation Function