misc: refactoring for logging system