code cleanup via pycharm code inspection