make more pythonic