curried socket handlers to make the code a bit clearer with closures