Refactored work hover function