Remove tooltip code duplication