Minor refactoring of Server Error code