Refactoring of log module.