Refactor invalidation.