some reorganization for text files