Move initializeSockets out of server