refactor refresh