Adapted refresh to new settings and added unit test for it