refactor visit status