Refactoring out bulk of tooltip logic