Make the socket api more comfortable