Cleaned up main server file.