Slightly less elegant but working version of refresh