extract cache invalidation to separate class/interface (start #238)