Refactore logger injection