Refactor and clean up GestureDetectorListener