remove read_file function, lines processing logic, refactoring