new logger (python style) + refactoring