separation of route, socket and stream handling