Tidying up wrapepr state machine and cache valiation/consolidation.