Updating and moving socket stuff to utils dir.