Better tooltip code to reduce reflows