simplify server code