TODO updates

The socket generation code could be improved in a number of ways