refactor logger