refactor logger creation