rewrite the refresh process to make more understandable.