Improved server logic.