- refactor logging