Logger code improved