Refactored.
Changed output file log format.