Can short circuit refresh if not needed
More elegant solution in refresh
Declarations outside loop