visitor can register [finish #79854006 #79854478]

Extract the class logic into a helper