Allow injecting of cache through factory