Make more pythonic