a bit more pythonic