txt format, refactoring