improve and extend logging