refactor mousemove listener.