#refactoring Extract addMouseEvents()