more pythonic as per krace