improved version of the refresh patch