Moved socket shit to seperate file