refactored and extracted strings up to line 800