cleaned up refresh logic