Update functions to do socket-work