more pythonic fixes