Refactoring for the ability to expose sockets out to clients