refactored class_member_visitor to be testable.