Refactor hoverbox.