Cleaned up server code.