log little refactoring