better cache handling