make it more pythonic