Refactored reading log file by IO