functions to emit reps and visitors
clear connections