Cache refactor fixes