Split mouse handling code into several small functions, removed 'tiny' screen size