some improvements in logging