Before refactor
Logging added