Refactoring gestureCancel method