AS-12 Refactor logging