Refactored the style and  hover functions