Refact gesture handlers.