Fix log.
Refactoring.