refactoring swipe (in progress)