ran checks with pychecker; imporved logging messages code