Move the tooltip functionality into a separate module.