refactor open visit