optimizing refreshing