some mouse functionality, split code into two parts