refactoring: remove duplication in logging manager