add more pythonic way