Changed using hammer.js for events
Refactoring js