Refactor logging
Merge branch 'implement'