Cleanup for server code