Style and nicety changes, based on pycharm advice