Implement cache invalidation on admin page. Minor refactoring.