Improved server code?