refactored visit recording into a model method