Improve mouse and touch events