Add log.
Refactoring.