clean server code