Refactored methods that deal with mouse behaviour.