Cleanup socket creation functions