Refactor and swipe to refresh