Refactor ConnectionsHandler