refactoring swipe.coffee