Cleans up server code