textwin refactored