pull to refresh code clean up