cleanup tooltip code