Refactor logger to use an interface