decouple invalidation from patching