refactor historicallogfile