Cleaned up the server code.