refactor code to allow hover state on list items