Small cache refactor