fix lint errors
refactor hover code