Fix scope
Clean closed connections
Fix clean client
Refactor new client handling