Add rubberband on mouse press, code reorganisation and cleanup