refactor mouse event callback