Still working on logging refactoring