Refactored code to a method to reuse code to replay animations on touch-tap gesture