Reduced code duplication

call @maxmaxoft!
calling...
call connected (0:20)
call ended