Some fixes and refactoring for gestures. Add TODO