refactor out http/socket servers