small tweaks to the refresh code