Refactor page visit related steps