Clean up server code