Fix structure of swipe code.