finished first phase of text refactor