a more idiomatic version of the server