Updated refresh to exclude non-visible elements