move socket creation