shorten the server code a bit