nested invalidate refactoring