Clean up cache handling a bit