Refresh button, better refresh algorithm