Cleaning up swiping code