Group mouse event logic together